phanpy-cz/assets/main-qoIDehIT.js.map
2024-11-16 11:51:00 +01:00

1 line
1.2 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"main-qoIDehIT.js","sources":["../../node_modules/just-debounce-it/index.mjs","../../node_modules/swiped-events/src/swiped-events.js","../../src/utils/usePageVisibility.js","../../src/components/background-service.jsx","../../src/components/compose-button.jsx","../../src/components/keyboard-shortcuts-help.jsx","../../node_modules/@formkit/auto-animate/index.mjs","../../node_modules/@formkit/auto-animate/preact/index.mjs","../../src/pages/accounts.jsx","../../src/assets/logo.svg","../../src/components/lang-selector.jsx","../../src/utils/push-notifications.js","../../src/pages/settings.jsx","../../src/utils/focus-deck.js","../../src/utils/useLocationChange.js","../../src/utils/lists.js","../../src/components/list-add-edit.jsx","../../src/components/account-info.jsx","../../src/components/account-sheet.jsx","../../src/components/drafts.jsx","../../src/components/embed-modal.jsx","../../src/components/generic-accounts.jsx","../../src/components/media-alt-modal.jsx","../../node_modules/chroma-js/src/utils/limit.js","../../node_modules/chroma-js/src/utils/type.js","../../node_modules/chroma-js/src/utils/unpack.js","../../node_modules/chroma-js/src/utils/index.js","../../node_modules/chroma-js/src/utils/multiply-matrices.js","../../node_modules/chroma-js/src/io/lab/lab-constants.js","../../node_modules/chroma-js/src/io/lab/lab2rgb.js","../../node_modules/chroma-js/src/io/oklab/oklab2rgb.js","../../node_modules/chroma-js/src/io/lab/rgb2lab.js","../../node_modules/chroma-js/src/io/oklab/rgb2oklab.js","../../node_modules/chroma-js/src/io/lch/lch2lab.js","../../node_modules/chroma-js/src/io/oklch/oklch2rgb.js","../../node_modules/chroma-js/src/io/lch/lab2lch.js","../../node_modules/chroma-js/src/io/oklch/rgb2oklch.js","../../src/components/media-modal.jsx","../../src/components/report-modal.jsx","../../node_modules/lz-string/libs/lz-string.js","../../src/assets/floating-button.svg","../../src/assets/multi-column.svg","../../src/assets/tab-menu-bar.svg","../../src/utils/followed-tags.js","../../src/components/AsyncText.jsx","../../src/components/shortcuts-settings.jsx","../../src/components/modals.jsx","../../src/components/follow-request-buttons.jsx","../../src/components/notification.jsx","../../src/components/notification-service.jsx","../../src/components/search-form.jsx","../../src/components/search-command.jsx","../../src/components/shortcuts.jsx","../../src/utils/timeline-utils.js","../../src/utils/useScroll.js","../../src/utils/useScrollFn.js","../../src/components/media-post.jsx","../../src/components/nav-menu.jsx","../../src/components/timeline.jsx","../../src/pages/account-statuses.jsx","../../src/pages/bookmarks.jsx","../../src/assets/features/catch-up.png","../../src/pages/catchup.jsx","../../src/pages/favourites.jsx","../../src/pages/filters.jsx","../../src/pages/followed-hashtags.jsx","../../src/pages/following.jsx","../../src/pages/hashtag.jsx","../../src/pages/list.jsx","../../src/utils/group-notifications.js","../../src/pages/mentions.jsx","../../src/pages/notifications.jsx","../../src/pages/public.jsx","../../src/pages/search.jsx","../../src/pages/trending.jsx","../../src/components/columns.jsx","../../src/pages/home.jsx","../../src/utils/get-instance-status-url.js","../../src/pages/http-route.jsx","../../src/pages/lists.jsx","../../src/data/instances.json?url","../../src/utils/oauth-pkce.js","../../src/utils/auth.js","../../src/pages/login.jsx","../../src/pages/status.jsx","../../src/pages/status-route.jsx","../../src/assets/features/boosts-carousel.jpg","../../src/assets/features/grouped-notifications.jpg","../../src/assets/features/multi-column.jpg","../../src/assets/features/multi-hashtag-timeline.jpg","../../src/assets/features/nested-comments-thread.jpg","../../src/assets/logo-text.svg","../../src/pages/welcome.jsx","../../src/utils/toast-alert.js","../../src/app.jsx","../../src/main.jsx"],"sourcesContent":["var functionDebounce = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n\nexport {functionDebounce as default};\n","/*!\n * swiped-events.js - v@version@\n * Pure JavaScript swipe events\n * https://github.com/john-doherty/swiped-events\n * @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element\n * @author John Doherty <www.johndoherty.info>\n * @license MIT\n */\n(function (window, document) {\n\n 'use strict';\n\n // patch CustomEvent to allow constructor creation (IE/Chrome)\n if (typeof window.CustomEvent !== 'function') {\n\n window.CustomEvent = function (event, params) {\n\n params = params || { bubbles: false, cancelable: false, detail: undefined };\n\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n window.CustomEvent.prototype = window.Event.prototype;\n }\n\n document.addEventListener('touchstart', handleTouchStart, false);\n document.addEventListener('touchmove', handleTouchMove, false);\n document.addEventListener('touchend', handleTouchEnd, false);\n\n var xDown = null;\n var yDown = null;\n var xDiff = null;\n var yDiff = null;\n var timeDown = null;\n var startEl = null;\n var touchCount = 0;\n\n /**\n * Fires swiped event if swipe detected on touchend\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchEnd(e) {\n\n // if the user released on a different target, cancel!\n if (startEl !== e.target) return;\n\n var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20 units\n var swipeUnit = getNearestAttribute(startEl, 'data-swipe-unit', 'px'); // default px\n var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms\n var timeDiff = Date.now() - timeDown;\n var eventType = '';\n var changedTouches = e.changedTouches || e.touches || [];\n\n if (swipeUnit === 'vh') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientHeight); // get percentage of viewport height in pixels\n }\n if (swipeUnit === 'vw') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientWidth); // get percentage of viewport height in pixels\n }\n\n if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant\n if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (xDiff > 0) {\n eventType = 'swiped-left';\n }\n else {\n eventType = 'swiped-right';\n }\n }\n }\n else if (Math.abs(yDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (yDiff > 0) {\n eventType = 'swiped-up';\n }\n else {\n eventType = 'swiped-down';\n }\n }\n\n if (eventType !== '') {\n\n var eventData = {\n dir: eventType.replace(/swiped-/, ''),\n touchType: (changedTouches[0] || {}).touchType || 'direct',\n fingers: touchCount, // Number of fingers used\n xStart: parseInt(xDown, 10),\n xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10),\n yStart: parseInt(yDown, 10),\n yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10)\n };\n\n // fire `swiped` event event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent('swiped', { bubbles: true, cancelable: true, detail: eventData }));\n\n // fire `swiped-dir` event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent(eventType, { bubbles: true, cancelable: true, detail: eventData }));\n }\n\n // reset values\n xDown = null;\n yDown = null;\n timeDown = null;\n }\n /**\n * Records current location on touchstart event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchStart(e) {\n\n // if the element has data-swipe-ignore=\"true\" we stop listening for swipe events\n if (e.target.getAttribute('data-swipe-ignore') === 'true') return;\n\n startEl = e.target;\n\n timeDown = Date.now();\n xDown = e.touches[0].clientX;\n yDown = e.touches[0].clientY;\n xDiff = 0;\n yDiff = 0;\n touchCount = e.touches.length;\n }\n\n /**\n * Records location diff in px on touchmove event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchMove(e) {\n\n if (!xDown || !yDown) return;\n\n var xUp = e.touches[0].clientX;\n var yUp = e.touches[0].clientY;\n\n xDiff = xDown - xUp;\n yDiff = yDown - yUp;\n }\n\n /**\n * Gets attribute off HTML element or nearest parent\n * @param {object} el - HTML element to retrieve attribute from\n * @param {string} attributeName - name of the attribute\n * @param {any} defaultValue - default value to return if no match found\n * @returns {any} attribute value or defaultValue\n */\n function getNearestAttribute(el, attributeName, defaultValue) {\n\n // walk up the dom tree looking for attributeName\n while (el && el !== document.documentElement) {\n\n var attributeValue = el.getAttribute(attributeName);\n\n if (attributeValue) {\n return attributeValue;\n }\n\n el = el.parentNode;\n }\n\n return defaultValue;\n }\n\n}(window, document));\n","import { useEffect, useRef } from 'preact/hooks';\n\nexport default function usePageVisibility(fn = () => {}, deps = []) {\n const savedCallback = useRef(fn);\n useEffect(() => {\n savedCallback.current = fn;\n }, [deps]);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n const hidden = document.hidden || document.visibilityState === 'hidden';\n console.log('👀 Page visibility changed', hidden ? 'hidden' : 'visible');\n savedCallback.current(!hidden);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n return () =>\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, []);\n}\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nconst STREAMING_TIMEOUT = 1000 * 3; // 3 seconds\nconst POLL_INTERVAL = 20_000; // 20 seconds\n\nexport default memo(function BackgroundService({ isLoggedIn }) {\n // Notifications service\n // - WebSocket to receive notifications when page is visible\n const [visible, setVisible] = useState(true);\n const visibleTimeout = useRef();\n usePageVisibility((visible) => {\n clearTimeout(visibleTimeout.current);\n if (visible) {\n setVisible(true);\n } else {\n visibleTimeout.current = setTimeout(() => {\n setVisible(false);\n }, POLL_INTERVAL);\n }\n });\n\n const checkLatestNotification = async (masto, instance, skipCheckMarkers) => {\n if (states.notificationsLast) {\n const notificationsIterator = masto.v1.notifications.list({\n limit: 1,\n sinceId: states.notificationsLast.id,\n });\n const { value: notifications } = await notificationsIterator.next();\n if (notifications?.length) {\n if (skipCheckMarkers) {\n states.notificationsShowNew = true;\n } else {\n let lastReadId;\n try {\n const markers = await masto.v1.markers.fetch({\n timeline: 'notifications',\n });\n lastReadId = markers?.notifications?.lastReadId;\n } catch (e) {}\n if (lastReadId) {\n states.notificationsShowNew = notifications[0].id !== lastReadId;\n } else {\n states.notificationsShowNew = true;\n }\n }\n }\n }\n };\n\n useEffect(() => {\n let sub;\n let streamTimeout;\n let pollNotifications;\n if (isLoggedIn && visible) {\n const { masto, streaming, instance } = api();\n (async () => {\n // 1. Get the latest notification\n await checkLatestNotification(masto, instance);\n\n let hasStreaming = false;\n // 2. Start streaming\n if (streaming) {\n streamTimeout = setTimeout(() => {\n (async () => {\n try {\n hasStreaming = true;\n sub = streaming.user.notification.subscribe();\n console.log('🎏 Streaming notification', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (!visible) break;\n console.log('🔔🔔 Notification entry', entry);\n if (entry.event === 'notification') {\n console.log('🔔🔔 Notification', entry);\n saveStatus(entry.payload, instance, {\n skipThreading: true,\n });\n }\n states.notificationsShowNew = true;\n }\n console.log('💥 Streaming notification loop STOPPED');\n } catch (e) {\n hasStreaming = false;\n console.error(e);\n }\n\n if (!hasStreaming) {\n console.log('🎏 Streaming failed, fallback to polling');\n pollNotifications = setInterval(() => {\n checkLatestNotification(masto, instance, true);\n }, POLL_INTERVAL);\n }\n })();\n }, STREAMING_TIMEOUT);\n }\n })();\n }\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n clearTimeout(streamTimeout);\n clearInterval(pollNotifications);\n };\n }, [visible, isLoggedIn]);\n\n // Check for updates service\n const lastCheckDate = useRef();\n const checkForUpdates = () => {\n lastCheckDate.current = Date.now();\n console.log('✨ Check app update');\n fetch('./version.json')\n .then((r) => r.json())\n .then((info) => {\n if (info) states.appVersion = info;\n })\n .catch((e) => {\n console.error(e);\n });\n };\n useInterval(checkForUpdates, visible && 1000 * 60 * 30); // 30 minutes\n usePageVisibility((visible) => {\n if (visible) {\n if (!lastCheckDate.current) {\n checkForUpdates();\n } else {\n const diff = Date.now() - lastCheckDate.current;\n if (diff > 1000 * 60 * 60) {\n // 1 hour\n checkForUpdates();\n }\n }\n }\n });\n\n // Global keyboard shortcuts \"service\"\n useHotkeys('shift+alt+k', () => {\n const currentCloakMode = states.settings.cloakMode;\n states.settings.cloakMode = !currentCloakMode;\n showToast({\n text: currentCloakMode ? t`Cloak mode disabled` : t`Cloak mode enabled`,\n });\n });\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport openCompose from '../utils/open-compose';\nimport openOSK from '../utils/open-osk';\nimport states from '../utils/states';\n\nimport Icon from './icon';\n\nexport default function ComposeButton() {\n const snapStates = useSnapshot(states);\n\n function handleButton(e) {\n if (snapStates.composerState.minimized) {\n states.composerState.minimized = false;\n openOSK();\n return;\n }\n\n if (e.shiftKey) {\n const newWin = openCompose();\n\n if (!newWin) {\n states.showCompose = true;\n }\n } else {\n openOSK();\n states.showCompose = true;\n }\n }\n\n useHotkeys('c, shift+c', handleButton, {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n });\n\n return (\n <button\n type=\"button\"\n id=\"compose-button\"\n onClick={handleButton}\n class={`${snapStates.composerState.minimized ? 'min' : ''} ${\n snapStates.composerState.publishing ? 'loading' : ''\n } ${snapStates.composerState.publishingError ? 'error' : ''}`}\n >\n <Icon icon=\"quill\" size=\"xl\" alt={t`Compose`} />\n </button>\n );\n}\n","import './keyboard-shortcuts-help.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Modal from './modal';\n\nexport default memo(function KeyboardShortcutsHelp() {\n const snapStates = useSnapshot(states);\n\n function onClose() {\n states.showKeyboardShortcutsHelp = false;\n }\n\n useHotkeys(\n '?, shift+?, shift+slash',\n (e) => {\n console.log('help');\n states.showKeyboardShortcutsHelp = true;\n },\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n\n return (\n !!snapStates.showKeyboardShortcutsHelp && (\n <Modal onClose={onClose}>\n <div id=\"keyboard-shortcuts-help-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Keyboard shortcuts</Trans>\n </h2>\n </header>\n <main>\n <table>\n <tbody>\n {[\n {\n action: t`Keyboard shortcuts help`,\n keys: <kbd>?</kbd>,\n },\n {\n action: t`Next post`,\n keys: <kbd>j</kbd>,\n },\n {\n action: t`Previous post`,\n keys: <kbd>k</kbd>,\n },\n {\n action: t`Skip carousel to next post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>j</kbd>\n </Trans>\n ),\n },\n {\n action: t`Skip carousel to previous post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n {\n action: t`Load new posts`,\n keys: <kbd>.</kbd>,\n },\n {\n action: t`Open post details`,\n keys: (\n <Trans>\n <kbd>Enter</kbd> or <kbd>o</kbd>\n </Trans>\n ),\n },\n {\n action: (\n <Trans>\n Expand content warning or\n <br />\n toggle expanded/collapsed thread\n </Trans>\n ),\n keys: <kbd>x</kbd>,\n },\n {\n action: t`Close post or dialogs`,\n keys: (\n <Trans>\n <kbd>Esc</kbd> or <kbd>Backspace</kbd>\n </Trans>\n ),\n },\n {\n action: t`Focus column in multi-column mode`,\n keys: (\n <Trans>\n <kbd>1</kbd> to <kbd>9</kbd>\n </Trans>\n ),\n },\n {\n action: t`Focus next column in multi-column mode`,\n keys: <kbd>]</kbd>,\n },\n {\n action: t`Focus previous column in multi-column mode`,\n keys: <kbd>[</kbd>,\n },\n {\n action: t`Compose new post`,\n keys: <kbd>c</kbd>,\n },\n {\n action: t`Compose new post (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>c</kbd>\n </Trans>\n ),\n },\n {\n action: t`Send post`,\n keys: (\n <Trans>\n <kbd>Ctrl</kbd> + <kbd>Enter</kbd> or <kbd>⌘</kbd> +{' '}\n <kbd>Enter</kbd>\n </Trans>\n ),\n },\n {\n action: t`Search`,\n keys: <kbd>/</kbd>,\n },\n {\n action: t`Reply`,\n keys: <kbd>r</kbd>,\n },\n {\n action: t`Reply (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>r</kbd>\n </Trans>\n ),\n },\n {\n action: t`Like (favourite)`,\n keys: (\n <Trans>\n <kbd>l</kbd> or <kbd>f</kbd>\n </Trans>\n ),\n },\n {\n action: t`Boost`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>b</kbd>\n </Trans>\n ),\n },\n {\n action: t`Bookmark`,\n keys: <kbd>d</kbd>,\n },\n {\n action: t`Toggle Cloak mode`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n ].map(({ action, className, keys }) => (\n <tr key={action}>\n <th class={className}>{action}</th>\n <td>{keys}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </main>\n </div>\n </Modal>\n )\n );\n});\n","/**\n * A set of all the parents currently being observe. This is the only non weak\n * registry.\n */\nconst parents = new Set();\n/**\n * Element coordinates that is constantly kept up to date.\n */\nconst coords = new WeakMap();\n/**\n * Siblings of elements that have been removed from the dom.\n */\nconst siblings = new WeakMap();\n/**\n * Animations that are currently running.\n */\nconst animations = new WeakMap();\n/**\n * A map of existing intersection observers used to track element movements.\n */\nconst intersections = new WeakMap();\n/**\n * Intervals for automatically checking the position of elements occasionally.\n */\nconst intervals = new WeakMap();\n/**\n * The configuration options for each group of elements.\n */\nconst options = new WeakMap();\n/**\n * Debounce counters by id, used to debounce calls to update positions.\n */\nconst debounces = new WeakMap();\n/**\n * All parents that are currently enabled are tracked here.\n */\nconst enabled = new WeakSet();\n/**\n * The document used to calculate transitions.\n */\nlet root;\n/**\n * The roots XY scroll positions.\n */\nlet scrollX = 0;\nlet scrollY = 0;\n/**\n * Used to sign an element as the target.\n */\nconst TGT = \"__aa_tgt\";\n/**\n * Used to sign an element as being part of a removal.\n */\nconst DEL = \"__aa_del\";\n/**\n * Used to sign an element as being \"new\". When an element is removed from the\n * dom, but may cycle back in we can sign it with new to ensure the next time\n * it is recognized we consider it new.\n */\nconst NEW = \"__aa_new\";\n/**\n * Callback for handling all mutations.\n * @param mutations - A mutation list\n */\nconst handleMutations = (mutations) => {\n const elements = getElements(mutations);\n // If elements is \"false\" that means this mutation that should be ignored.\n if (elements) {\n elements.forEach((el) => animate(el));\n }\n};\n/**\n *\n * @param entries - Elements that have been resized.\n */\nconst handleResizes = (entries) => {\n entries.forEach((entry) => {\n if (entry.target === root)\n updateAllPos();\n if (coords.has(entry.target))\n updatePos(entry.target);\n });\n};\n/**\n * Observe this elements position.\n * @param el - The element to observe the position of.\n */\nfunction observePosition(el) {\n const oldObserver = intersections.get(el);\n oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect();\n let rect = coords.get(el);\n let invocations = 0;\n const buffer = 5;\n if (!rect) {\n rect = getCoords(el);\n coords.set(el, rect);\n }\n const { offsetWidth, offsetHeight } = root;\n const rootMargins = [\n rect.top - buffer,\n offsetWidth - (rect.left + buffer + rect.width),\n offsetHeight - (rect.top + buffer + rect.height),\n rect.left - buffer,\n ];\n const rootMargin = rootMargins\n .map((px) => `${-1 * Math.floor(px)}px`)\n .join(\" \");\n const observer = new IntersectionObserver(() => {\n ++invocations > 1 && updatePos(el);\n }, {\n root,\n threshold: 1,\n rootMargin,\n });\n observer.observe(el);\n intersections.set(el, observer);\n}\n/**\n * Update the exact position of a given element.\n * @param el - An element to update the position of.\n */\nfunction updatePos(el) {\n clearTimeout(debounces.get(el));\n const optionsOrPlugin = getOptions(el);\n const delay = isPlugin(optionsOrPlugin) ? 500 : optionsOrPlugin.duration;\n debounces.set(el, setTimeout(async () => {\n const currentAnimation = animations.get(el);\n try {\n await (currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.finished);\n coords.set(el, getCoords(el));\n observePosition(el);\n }\n catch {\n // ignore errors as the `.finished` promise is rejected when animations were cancelled\n }\n }, delay));\n}\n/**\n * Updates all positions that are currently being tracked.\n */\nfunction updateAllPos() {\n clearTimeout(debounces.get(root));\n debounces.set(root, setTimeout(() => {\n parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));\n }, 100));\n}\n/**\n * Its possible for a quick scroll or other fast events to get past the\n * intersection observer, so occasionally we need want \"cold-poll\" for the\n * latests and greatest position. We try to do this in the most non-disruptive\n * fashion possible. First we only do this ever couple seconds, staggard by a\n * random offset.\n * @param el - Element\n */\nfunction poll(el) {\n setTimeout(() => {\n intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000));\n }, Math.round(2000 * Math.random()));\n}\n/**\n * Perform some operation that is non critical at some point.\n * @param callback\n */\nfunction lowPriority(callback) {\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => callback());\n }\n else {\n requestAnimationFrame(() => callback());\n }\n}\n/**\n * The mutation observer responsible for watching each root element.\n */\nlet mutations;\n/**\n * A resize observer, responsible for recalculating elements on resize.\n */\nlet resize;\n/**\n * Ensure the browser is supported.\n */\nconst supportedBrowser = typeof window !== \"undefined\" && \"ResizeObserver\" in window;\n/**\n * If this is in a browser, initialize our Web APIs\n */\nif (supportedBrowser) {\n root = document.documentElement;\n mutations = new MutationObserver(handleMutations);\n resize = new ResizeObserver(handleResizes);\n window.addEventListener(\"scroll\", () => {\n scrollY = window.scrollY;\n scrollX = window.scrollX;\n });\n resize.observe(root);\n}\n/**\n * Retrieves all the elements that may have been affected by the last mutation\n * including ones that have been removed and are no longer in the DOM.\n * @param mutations - A mutation list.\n * @returns\n */\nfunction getElements(mutations) {\n const observedNodes = mutations.reduce((nodes, mutation) => {\n return [\n ...nodes,\n ...Array.from(mutation.addedNodes),\n ...Array.from(mutation.removedNodes),\n ];\n }, []);\n // Short circuit if _only_ comment nodes are observed\n const onlyCommentNodesObserved = observedNodes.every((node) => node.nodeName === \"#comment\");\n if (onlyCommentNodesObserved)\n return false;\n return mutations.reduce((elements, mutation) => {\n // Short circuit if we find a purposefully deleted node.\n if (elements === false)\n return false;\n if (mutation.target instanceof Element) {\n target(mutation.target);\n if (!elements.has(mutation.target)) {\n elements.add(mutation.target);\n for (let i = 0; i < mutation.target.children.length; i++) {\n const child = mutation.target.children.item(i);\n if (!child)\n continue;\n if (DEL in child) {\n return false;\n }\n target(mutation.target, child);\n elements.add(child);\n }\n }\n if (mutation.removedNodes.length) {\n for (let i = 0; i < mutation.removedNodes.length; i++) {\n const child = mutation.removedNodes[i];\n if (DEL in child) {\n return false;\n }\n if (child instanceof Element) {\n elements.add(child);\n target(mutation.target, child);\n siblings.set(child, [\n mutation.previousSibling,\n mutation.nextSibling,\n ]);\n }\n }\n }\n }\n return elements;\n }, new Set());\n}\n/**\n * Assign the target to an element.\n * @param el - The root element\n * @param child\n */\nfunction target(el, child) {\n if (!child && !(TGT in el))\n Object.defineProperty(el, TGT, { value: el });\n else if (child && !(TGT in child))\n Object.defineProperty(child, TGT, { value: el });\n}\n/**\n * Determines what kind of change took place on the given element and then\n * performs the proper animation based on that.\n * @param el - The specific element to animate.\n */\nfunction animate(el) {\n var _a;\n const isMounted = el.isConnected;\n const preExisting = coords.has(el);\n if (isMounted && siblings.has(el))\n siblings.delete(el);\n if (animations.has(el)) {\n (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel();\n }\n if (NEW in el) {\n add(el);\n }\n else if (preExisting && isMounted) {\n remain(el);\n }\n else if (preExisting && !isMounted) {\n remove(el);\n }\n else {\n add(el);\n }\n}\n/**\n * Removes all non-digits from a string and casts to a number.\n * @param str - A string containing a pixel value.\n * @returns\n */\nfunction raw(str) {\n return Number(str.replace(/[^0-9.\\-]/g, \"\"));\n}\n/**\n * Get the scroll offset of elements\n * @param el - Element\n * @returns\n */\nfunction getScrollOffset(el) {\n let p = el.parentElement;\n while (p) {\n if (p.scrollLeft || p.scrollTop) {\n return { x: p.scrollLeft, y: p.scrollTop };\n }\n p = p.parentElement;\n }\n return { x: 0, y: 0 };\n}\n/**\n * Get the coordinates of elements adjusted for scroll position.\n * @param el - Element\n * @returns\n */\nfunction getCoords(el) {\n const rect = el.getBoundingClientRect();\n const { x, y } = getScrollOffset(el);\n return {\n top: rect.top + y,\n left: rect.left + x,\n width: rect.width,\n height: rect.height,\n };\n}\n/**\n * Returns the width/height that the element should be transitioned between.\n * This takes into account box-sizing.\n * @param el - Element being animated\n * @param oldCoords - Old set of Coordinates coordinates\n * @param newCoords - New set of Coordinates coordinates\n * @returns\n */\nfunction getTransitionSizes(el, oldCoords, newCoords) {\n let widthFrom = oldCoords.width;\n let heightFrom = oldCoords.height;\n let widthTo = newCoords.width;\n let heightTo = newCoords.height;\n const styles = getComputedStyle(el);\n const sizing = styles.getPropertyValue(\"box-sizing\");\n if (sizing === \"content-box\") {\n const paddingY = raw(styles.paddingTop) +\n raw(styles.paddingBottom) +\n raw(styles.borderTopWidth) +\n raw(styles.borderBottomWidth);\n const paddingX = raw(styles.paddingLeft) +\n raw(styles.paddingRight) +\n raw(styles.borderRightWidth) +\n raw(styles.borderLeftWidth);\n widthFrom -= paddingX;\n widthTo -= paddingX;\n heightFrom -= paddingY;\n heightTo -= paddingY;\n }\n return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round);\n}\n/**\n * Retrieves animation options for the current element.\n * @param el - Element to retrieve options for.\n * @returns\n */\nfunction getOptions(el) {\n return TGT in el && options.has(el[TGT])\n ? options.get(el[TGT])\n : { duration: 250, easing: \"ease-in-out\" };\n}\n/**\n * Returns the target of a given animation (generally the parent).\n * @param el - An element to check for a target\n * @returns\n */\nfunction getTarget(el) {\n if (TGT in el)\n return el[TGT];\n return undefined;\n}\n/**\n * Checks if animations are enabled or disabled for a given element.\n * @param el - Any element\n * @returns\n */\nfunction isEnabled(el) {\n const target = getTarget(el);\n return target ? enabled.has(target) : false;\n}\n/**\n * Iterate over the children of a given parent.\n * @param parent - A parent element\n * @param callback - A callback\n */\nfunction forEach(parent, ...callbacks) {\n callbacks.forEach((callback) => callback(parent, options.has(parent)));\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children.item(i);\n if (child) {\n callbacks.forEach((callback) => callback(child, options.has(child)));\n }\n }\n}\n/**\n * Always return tuple to provide consistent interface\n */\nfunction getPluginTuple(pluginReturn) {\n if (Array.isArray(pluginReturn))\n return pluginReturn;\n return [pluginReturn];\n}\n/**\n * Determine if config is plugin\n */\nfunction isPlugin(config) {\n return typeof config === \"function\";\n}\n/**\n * The element in question is remaining in the DOM.\n * @param el - Element to flip\n * @returns\n */\nfunction remain(el) {\n const oldCoords = coords.get(el);\n const newCoords = getCoords(el);\n if (!isEnabled(el))\n return coords.set(el, newCoords);\n let animation;\n if (!oldCoords)\n return;\n const pluginOrOptions = getOptions(el);\n if (typeof pluginOrOptions !== \"function\") {\n const deltaX = oldCoords.left - newCoords.left;\n const deltaY = oldCoords.top - newCoords.top;\n const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);\n const start = {\n transform: `translate(${deltaX}px, ${deltaY}px)`,\n };\n const end = {\n transform: `translate(0, 0)`,\n };\n if (widthFrom !== widthTo) {\n start.width = `${widthFrom}px`;\n end.width = `${widthTo}px`;\n }\n if (heightFrom !== heightTo) {\n start.height = `${heightFrom}px`;\n end.height = `${heightTo}px`;\n }\n animation = el.animate([start, end], {\n duration: pluginOrOptions.duration,\n easing: pluginOrOptions.easing,\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"remain\", oldCoords, newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n coords.set(el, newCoords);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Adds the element with a transition.\n * @param el - Animates the element being added.\n */\nfunction add(el) {\n if (NEW in el)\n delete el[NEW];\n const newCoords = getCoords(el);\n coords.set(el, newCoords);\n const pluginOrOptions = getOptions(el);\n if (!isEnabled(el))\n return;\n let animation;\n if (typeof pluginOrOptions !== \"function\") {\n animation = el.animate([\n { transform: \"scale(.98)\", opacity: 0 },\n { transform: \"scale(0.98)\", opacity: 0, offset: 0.5 },\n { transform: \"scale(1)\", opacity: 1 },\n ], {\n duration: pluginOrOptions.duration * 1.5,\n easing: \"ease-in\",\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"add\", newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Clean up after removing an element from the dom.\n * @param el - Element being removed\n * @param styles - Optional styles that should be removed from the element.\n */\nfunction cleanUp(el, styles) {\n var _a;\n el.remove();\n coords.delete(el);\n siblings.delete(el);\n animations.delete(el);\n (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect();\n setTimeout(() => {\n if (DEL in el)\n delete el[DEL];\n Object.defineProperty(el, NEW, { value: true, configurable: true });\n if (styles && el instanceof HTMLElement) {\n for (const style in styles) {\n el.style[style] = \"\";\n }\n }\n }, 0);\n}\n/**\n * Animates the removal of an element.\n * @param el - Element to remove\n */\nfunction remove(el) {\n var _a;\n if (!siblings.has(el) || !coords.has(el))\n return;\n const [prev, next] = siblings.get(el);\n Object.defineProperty(el, DEL, { value: true, configurable: true });\n const finalX = window.scrollX;\n const finalY = window.scrollY;\n if (next && next.parentNode && next.parentNode instanceof Element) {\n next.parentNode.insertBefore(el, next);\n }\n else if (prev && prev.parentNode) {\n prev.parentNode.appendChild(el);\n }\n else {\n (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el);\n }\n if (!isEnabled(el))\n return cleanUp(el);\n const [top, left, width, height] = deletePosition(el);\n const optionsOrPlugin = getOptions(el);\n const oldCoords = coords.get(el);\n if (finalX !== scrollX || finalY !== scrollY) {\n adjustScroll(el, finalX, finalY, optionsOrPlugin);\n }\n let animation;\n let styleReset = {\n position: \"absolute\",\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n margin: \"0\",\n pointerEvents: \"none\",\n transformOrigin: \"center\",\n zIndex: \"100\",\n };\n if (!isPlugin(optionsOrPlugin)) {\n Object.assign(el.style, styleReset);\n animation = el.animate([\n {\n transform: \"scale(1)\",\n opacity: 1,\n },\n {\n transform: \"scale(.98)\",\n opacity: 0,\n },\n ], { duration: optionsOrPlugin.duration, easing: \"ease-out\" });\n }\n else {\n const [keyframes, options] = getPluginTuple(optionsOrPlugin(el, \"remove\", oldCoords));\n if ((options === null || options === void 0 ? void 0 : options.styleReset) !== false) {\n styleReset = (options === null || options === void 0 ? void 0 : options.styleReset) || styleReset;\n Object.assign(el.style, styleReset);\n }\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", cleanUp.bind(null, el, styleReset));\n}\n/**\n * If the element being removed is at the very bottom of the page, and the\n * the page was scrolled into a space being \"made available\" by the element\n * that was removed, the page scroll will have jumped up some amount. We need\n * to offset the jump by the amount that the page was \"automatically\" scrolled\n * up. We can do this by comparing the scroll position before and after the\n * element was removed, and then offsetting by that amount.\n *\n * @param el - The element being deleted\n * @param finalX - The final X scroll position\n * @param finalY - The final Y scroll position\n * @param optionsOrPlugin - The options or plugin\n * @returns\n */\nfunction adjustScroll(el, finalX, finalY, optionsOrPlugin) {\n const scrollDeltaX = scrollX - finalX;\n const scrollDeltaY = scrollY - finalY;\n const scrollBefore = document.documentElement.style.scrollBehavior;\n const scrollBehavior = getComputedStyle(root).scrollBehavior;\n if (scrollBehavior === \"smooth\") {\n document.documentElement.style.scrollBehavior = \"auto\";\n }\n window.scrollTo(window.scrollX + scrollDeltaX, window.scrollY + scrollDeltaY);\n if (!el.parentElement)\n return;\n const parent = el.parentElement;\n let lastHeight = parent.clientHeight;\n let lastWidth = parent.clientWidth;\n const startScroll = performance.now();\n // Here we use a manual scroll animation to keep the element using the same\n // easing and timing as the parents scroll animation.\n function smoothScroll() {\n requestAnimationFrame(() => {\n if (!isPlugin(optionsOrPlugin)) {\n const deltaY = lastHeight - parent.clientHeight;\n const deltaX = lastWidth - parent.clientWidth;\n if (startScroll + optionsOrPlugin.duration > performance.now()) {\n window.scrollTo({\n left: window.scrollX - deltaX,\n top: window.scrollY - deltaY,\n });\n lastHeight = parent.clientHeight;\n lastWidth = parent.clientWidth;\n smoothScroll();\n }\n else {\n document.documentElement.style.scrollBehavior = scrollBefore;\n }\n }\n });\n }\n smoothScroll();\n}\n/**\n * Determines the position of the element being removed.\n * @param el - The element being deleted\n * @returns\n */\nfunction deletePosition(el) {\n const oldCoords = coords.get(el);\n const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));\n let offsetParent = el.parentElement;\n while (offsetParent &&\n (getComputedStyle(offsetParent).position === \"static\" ||\n offsetParent instanceof HTMLBodyElement)) {\n offsetParent = offsetParent.parentElement;\n }\n if (!offsetParent)\n offsetParent = document.body;\n const parentStyles = getComputedStyle(offsetParent);\n const parentCoords = coords.get(offsetParent) || getCoords(offsetParent);\n const top = Math.round(oldCoords.top - parentCoords.top) -\n raw(parentStyles.borderTopWidth);\n const left = Math.round(oldCoords.left - parentCoords.left) -\n raw(parentStyles.borderLeftWidth);\n return [top, left, width, height];\n}\n/**\n * A function that automatically adds animation effects to itself and its\n * immediate children. Specifically it adds effects for adding, moving, and\n * removing DOM elements.\n * @param el - A parent element to add animations to.\n * @param options - An optional object of options.\n */\nfunction autoAnimate(el, config = {}) {\n if (mutations && resize) {\n const mediaQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const isDisabledDueToReduceMotion = mediaQuery.matches &&\n !isPlugin(config) &&\n !config.disrespectUserMotionPreference;\n if (!isDisabledDueToReduceMotion) {\n enabled.add(el);\n if (getComputedStyle(el).position === \"static\") {\n Object.assign(el.style, { position: \"relative\" });\n }\n forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));\n if (isPlugin(config)) {\n options.set(el, config);\n }\n else {\n options.set(el, { duration: 250, easing: \"ease-in-out\", ...config });\n }\n mutations.observe(el, { childList: true });\n parents.add(el);\n }\n }\n return Object.freeze({\n parent: el,\n enable: () => {\n enabled.add(el);\n },\n disable: () => {\n enabled.delete(el);\n },\n isEnabled: () => enabled.has(el),\n });\n}\n/**\n * The vue directive.\n */\nconst vAutoAnimate = {\n mounted: (el, binding) => {\n autoAnimate(el, binding.value || {});\n },\n // ignore ssr see #96:\n getSSRProps: () => ({}),\n};\n\nexport { autoAnimate as default, getTransitionSizes, vAutoAnimate };\n","import { useRef, useState, useEffect } from 'preact/hooks';\nimport autoAnimate from '../index.mjs';\n\n/**\n * AutoAnimate hook for adding dead-simple transitions and animations to preact.\n * @param options - Auto animate options or a plugin\n * @returns\n */\nfunction useAutoAnimate(options) {\n const element = useRef(null);\n const [controller, setController] = useState();\n const setEnabled = (enabled) => {\n if (controller) {\n enabled ? controller.enable() : controller.disable();\n }\n };\n useEffect(() => {\n if (element.current instanceof HTMLElement)\n setController(autoAnimate(element.current, options || {}));\n }, []);\n return [element, setEnabled];\n}\n\nexport { useAutoAnimate };\n","import './accounts.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useReducer } from 'preact/hooks';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, setCurrentAccountID } from '../utils/store-utils';\n\nconst isStandalone = window.matchMedia('(display-mode: standalone)').matches;\n\nfunction Accounts({ onClose }) {\n const { masto } = api();\n // Accounts\n const accounts = store.local.getJSON('accounts');\n const currentAccount = getCurrentAccountID();\n const moreThanOneAccount = accounts.length > 1;\n\n const [_, reload] = useReducer((x) => x + 1, 0);\n const [accountsListParent] = useAutoAnimate();\n\n return (\n <div id=\"accounts-container\" class=\"sheet\" tabIndex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Accounts</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul class=\"accounts-list\" ref={accountsListParent}>\n {accounts.map((account, i) => {\n const isCurrent = account.info.id === currentAccount;\n const isDefault = i === 0; // first account is always default\n return (\n <li key={account.info.id}>\n <div>\n {moreThanOneAccount && (\n <span class={`current ${isCurrent ? 'is-current' : ''}`}>\n <Icon icon=\"check-circle\" alt={t`Current`} />\n </span>\n )}\n <Avatar\n url={account.info.avatarStatic}\n size=\"xxl\"\n onDblClick={async () => {\n if (isCurrent) {\n try {\n const info = await masto.v1.accounts\n .$select(account.info.id)\n .fetch();\n console.log('fetched account info', info);\n account.info = info;\n store.local.setJSON('accounts', accounts);\n reload();\n } catch (e) {}\n }\n }}\n />\n <NameText\n account={\n moreThanOneAccount\n ? {\n ...account.info,\n acct: /@/.test(account.info.acct)\n ? account.info.acct\n : `${account.info.acct}@${account.instanceURL}`,\n }\n : account.info\n }\n showAcct\n onClick={() => {\n if (isCurrent) {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n } else {\n setCurrentAccountID(account.info.id);\n location.reload();\n }\n }}\n />\n </div>\n <div class=\"actions\">\n {isDefault && moreThanOneAccount && (\n <>\n <span class=\"tag\">\n <Trans>Default</Trans>\n </span>{' '}\n </>\n )}\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain more-button\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {moreThanOneAccount && (\n <>\n <MenuItem\n disabled={isCurrent}\n onClick={() => {\n setCurrentAccountID(account.info.id);\n location.reload();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>Switch to this account</Trans>\n </MenuItem>\n {!isStandalone && !isCurrent && (\n <MenuLink\n href={`./?account=${account.info.id}`}\n target=\"_blank\"\n >\n <Icon icon=\"external\" />\n <span>\n <Trans>Switch in new tab/window</Trans>\n </span>\n </MenuLink>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n }}\n >\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n {moreThanOneAccount && (\n <MenuItem\n disabled={isDefault}\n onClick={() => {\n // Move account to the top of the list\n accounts.splice(i, 1);\n accounts.unshift(account);\n store.local.setJSON('accounts', accounts);\n reload();\n }}\n >\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Set as default</Trans>\n </span>\n </MenuItem>\n )}\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"exit\" />\n <span>\n <Trans>\n Log out{' '}\n <span class=\"bidi-isolate\">\n @{account.info.acct}\n </span>\n ?\n </Trans>\n </span>\n </>\n }\n disabled={!isCurrent}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Log out?');\n // if (!yes) return;\n accounts.splice(i, 1);\n store.local.setJSON('accounts', accounts);\n // location.reload();\n location.href = location.pathname || '/';\n }}\n >\n <Icon icon=\"exit\" />\n <span>\n <Trans>Log out…</Trans>\n </span>\n </MenuConfirm>\n </Menu2>\n </div>\n </li>\n );\n })}\n </ul>\n <p>\n <Link to=\"/login\" class=\"button plain2\" onClick={onClose}>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Add an existing account</Trans>\n </span>\n </Link>\n </p>\n {moreThanOneAccount && (\n <p>\n <small>\n <Trans>\n Note: <i>Default</i> account will always be used for first\n load. Switched accounts will persist during the session.\n </Trans>\n </small>\n </p>\n )}\n </section>\n </main>\n </div>\n );\n}\n\nexport default Accounts;\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e\"","import { useLingui } from '@lingui/react';\nimport { useMemo } from 'preact/hooks';\n\nimport { CATALOGS, DEFAULT_LANG, DEV_LOCALES, LOCALES } from '../locales';\nimport { activateLang } from '../utils/lang';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport store from '../utils/store';\n\nconst regionMaps = {\n 'zh-CN': 'zh-Hans',\n 'zh-TW': 'zh-Hant',\n 'pt-BR': 'pt-BR',\n};\n\nexport default function LangSelector() {\n const { i18n } = useLingui();\n\n // Sorted on render, so the order won't suddenly change based on current locale\n const populatedLocales = useMemo(() => {\n return LOCALES.map((lang) => {\n // Don't need regions for now, it makes text too noisy\n // Wait till there's too many languages and there are regional clashes\n const regionlessCode = regionMaps[lang] || lang.replace(/-[a-z]+$/i, '');\n\n const native = localeCode2Text({\n code: regionlessCode,\n locale: lang,\n fallback: CATALOGS.find((c) => c.code === lang)?.nativeName,\n });\n\n // Not used when rendering because it'll change based on current locale\n // Only used for sorting on render\n const _common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === lang)?.name,\n });\n\n return {\n code: lang,\n regionlessCode,\n _common,\n native,\n };\n }).sort((a, b) => {\n // Sort by common name\n const order = a._common.localeCompare(b._common, i18n.locale);\n if (order !== 0) return order;\n // Sort by code (fallback)\n if (a.code < b.code) return -1;\n if (a.code > b.code) return 1;\n return 0;\n });\n }, []);\n\n return (\n <label class=\"lang-selector\">\n 🌐{' '}\n <select\n class=\"small\"\n value={i18n.locale || DEFAULT_LANG}\n onChange={(e) => {\n store.local.set('lang', e.target.value);\n activateLang(e.target.value);\n }}\n >\n {populatedLocales.map(({ code, regionlessCode, native }) => {\n // Common name changes based on current locale\n const common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === code)?.name,\n });\n const showCommon = !!common && common !== native;\n return (\n <option\n value={code}\n data-regionless-code={regionlessCode}\n key={code}\n >\n {showCommon ? `${native} - ${common}` : native}\n </option>\n );\n })}\n {(import.meta.env.DEV || import.meta.env.PHANPY_SHOW_DEV_LOCALES) && (\n <optgroup label=\"🚧 Development (<50% translated)\">\n {DEV_LOCALES.map((code) => {\n if (code === 'pseudo-LOCALE') {\n return (\n <>\n <hr />\n <option value={code} key={code}>\n Pseudolocalization (test)\n </option>\n </>\n );\n }\n const nativeName = CATALOGS.find(\n (c) => c.code === code,\n )?.nativeName;\n const completion = CATALOGS.find(\n (c) => c.code === code,\n )?.completion;\n return (\n <option value={code} key={code}>\n {nativeName || code} &lrm;[{completion}%]\n </option>\n );\n })}\n </optgroup>\n )}\n </select>\n </label>\n );\n}\n","// Utils for push notifications\nimport { api } from './api';\nimport { getVapidKey } from './store-utils';\n\n// Subscription is an object with the following structure:\n// {\n// data: {\n// alerts: {\n// admin: {\n// report: boolean,\n// signUp: boolean,\n// },\n// favourite: boolean,\n// follow: boolean,\n// mention: boolean,\n// poll: boolean,\n// reblog: boolean,\n// status: boolean,\n// update: boolean,\n// }\n// },\n// policy: \"all\" | \"followed\" | \"follower\" | \"none\",\n// subscription: {\n// endpoint: string,\n// keys: {\n// auth: string,\n// p256dh: string,\n// },\n// },\n// }\n\n// Back-end CRUD\n// =============\n\nfunction createBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.create(subscription);\n}\n\nfunction fetchBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.fetch();\n}\n\nfunction updateBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.update(subscription);\n}\n\nfunction removeBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.remove();\n}\n\n// Front-end\n// =========\n\nexport function isPushSupported() {\n return 'serviceWorker' in navigator && 'PushManager' in window;\n}\n\nexport function getRegistration() {\n // return navigator.serviceWorker.ready;\n return navigator.serviceWorker.getRegistration();\n}\n\nasync function getSubscription() {\n const registration = await getRegistration();\n const subscription = registration\n ? await registration.pushManager.getSubscription()\n : undefined;\n return { registration, subscription };\n}\n\nfunction urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = `${base64String}${padding}`\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}\n\n// Front-end <-> back-end\n// ======================\n\nexport async function initSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n let backendSubscription = null;\n try {\n backendSubscription = await fetchBackendPushSubscription();\n } catch (err) {\n if (/(not found|unknown)/i.test(err.message)) {\n // No subscription found\n } else {\n // Other error\n throw err;\n }\n }\n console.log('INIT subscription', {\n subscription,\n backendSubscription,\n });\n\n // Check if the subscription changed\n if (backendSubscription && subscription) {\n const sameEndpoint = backendSubscription.endpoint === subscription.endpoint;\n const vapidKey = getVapidKey();\n const sameKey = backendSubscription.serverKey === vapidKey;\n if (!sameEndpoint) {\n throw new Error('Backend subscription endpoint changed');\n }\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n sameEndpoint,\n serverKey: backendSubscription.serverKey,\n vapIdKey: vapidKey,\n endpoint1: backendSubscription.endpoint,\n endpoint2: subscription.endpoint,\n sameKey,\n key1: backendSubscription.serverKey,\n key2: vapidKey,\n });\n throw new Error('Backend subscription key and vapid key changed');\n // Only unsubscribe from backend, not from browser\n // await removeBackendPushSubscription();\n // // Now let's resubscribe\n // // NOTE: I have no idea if this works\n // return await updateSubscription({\n // data: backendSubscription.data,\n // policy: backendSubscription.policy,\n // });\n }\n }\n\n if (subscription && !backendSubscription) {\n // check if account's vapidKey is same as subscription's applicationServerKey\n const vapidKey = getVapidKey();\n if (vapidKey) {\n const { applicationServerKey } = subscription.options;\n const vapidKeyStr = urlBase64ToUint8Array(vapidKey).toString();\n const applicationServerKeyStr = new Uint8Array(\n applicationServerKey,\n ).toString();\n const sameKey = vapidKeyStr === applicationServerKeyStr;\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n vapidKeyStr,\n applicationServerKeyStr,\n sameKey,\n });\n // Unsubscribe since backend doesn't have a subscription\n await subscription.unsubscribe();\n throw new Error('Subscription key and vapid key changed');\n }\n } else {\n console.warn('No vapidKey found');\n }\n }\n\n // Check if backend subscription returns 404\n // if (subscription && !backendSubscription) {\n // // Re-subscribe to backend\n // backendSubscription = await createBackendPushSubscription({\n // subscription,\n // data: {},\n // policy: 'all',\n // });\n // }\n\n return { subscription, backendSubscription };\n}\n\nexport async function updateSubscription({ data, policy }) {\n console.log('🔔 Updating subscription', { data, policy });\n if (!isPushSupported()) return;\n let { registration, subscription } = await getSubscription();\n let backendSubscription = null;\n\n if (subscription) {\n try {\n backendSubscription = await updateBackendPushSubscription({\n data,\n policy,\n });\n // TODO: save subscription in user settings\n } catch (error) {\n // Backend doesn't have a subscription for this user\n // Create a new one\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n } else {\n // User is not subscribed\n const vapidKey = getVapidKey();\n if (!vapidKey) throw new Error('No server key found');\n subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(vapidKey),\n });\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n\n return { subscription, backendSubscription };\n}\n\nexport async function removeSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n if (subscription) {\n await removeBackendPushSubscription();\n await subscription.unsubscribe();\n }\n}\n","import './settings.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport logo from '../assets/logo.svg';\n\nimport Icon from '../components/icon';\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport RelativeTime from '../components/relative-time';\nimport targetLanguages from '../data/lingva-target-languages';\nimport { api } from '../utils/api';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport prettyBytes from '../utils/pretty-bytes';\nimport {\n initSubscription,\n isPushSupported,\n removeSubscription,\n updateSubscription,\n} from '../utils/push-notifications';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport supports from '../utils/supports';\n\nconst DEFAULT_TEXT_SIZE = 16;\nconst TEXT_SIZES = [14, 15, 16, 17, 18, 19, 20];\nconst {\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,\n PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,\n} = import.meta.env;\n\nfunction Settings({ onClose }) {\n const snapStates = useSnapshot(states);\n const currentTheme = store.local.get('theme') || 'auto';\n const themeFormRef = useRef();\n const targetLanguage =\n snapStates.settings.contentTranslationTargetLanguage || null;\n const systemTargetLanguage = getTranslateTargetLanguage();\n const systemTargetLanguageText = localeCode2Text(systemTargetLanguage);\n const currentTextSize = store.local.get('textSize') || DEFAULT_TEXT_SIZE;\n\n const [prefs, setPrefs] = useState(store.account.get('preferences') || {});\n const { masto, authenticated, instance } = api();\n // Get preferences every time Settings is opened\n // NOTE: Disabled for now because I don't expect this to change often. Also for some reason, the /api/v1/preferences endpoint is cached for a while and return old prefs if refresh immediately after changing them.\n // useEffect(() => {\n // const { masto } = api();\n // (async () => {\n // try {\n // const preferences = await masto.v1.preferences.fetch();\n // setPrefs(preferences);\n // store.account.set('preferences', preferences);\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // })();\n // }, []);\n\n return (\n <div\n id=\"settings-container\"\n class=\"sheet\"\n tabIndex=\"-1\"\n style={{\n '--current-text-size': `${currentTextSize}px`,\n }}\n >\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Settings</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul>\n <li>\n <div>\n <label>\n <Trans>Appearance</Trans>\n </label>\n </div>\n <div>\n <form\n ref={themeFormRef}\n onInput={(e) => {\n console.log(e);\n e.preventDefault();\n const formData = new FormData(themeFormRef.current);\n const theme = formData.get('theme');\n const html = document.documentElement;\n\n if (theme === 'auto') {\n html.classList.remove('is-light', 'is-dark');\n\n // Disable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = '';\n }\n // Enable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = 'theme-color';\n });\n } else {\n html.classList.toggle('is-light', theme === 'light');\n html.classList.toggle('is-dark', theme === 'dark');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute(\n 'content',\n theme === 'auto' ? 'dark light' : theme,\n );\n\n if (theme === 'auto') {\n store.local.del('theme');\n } else {\n store.local.set('theme', theme);\n }\n }}\n >\n <div class=\"radio-group\">\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"light\"\n defaultChecked={currentTheme === 'light'}\n />\n <span>\n <Trans>Light</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"dark\"\n defaultChecked={currentTheme === 'dark'}\n />\n <span>\n <Trans>Dark</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"auto\"\n defaultChecked={\n currentTheme !== 'light' && currentTheme !== 'dark'\n }\n />\n <span>\n <Trans>Auto</Trans>\n </span>\n </label>\n </div>\n </form>\n </div>\n </li>\n <li>\n <div>\n <label>\n <Trans>Text size</Trans>\n </label>\n </div>\n <div class=\"range-group\">\n <span style={{ fontSize: TEXT_SIZES[0] }}>\n <Trans comment=\"Preview of one character, in smallest size\">\n A\n </Trans>\n </span>{' '}\n <input\n type=\"range\"\n min={TEXT_SIZES[0]}\n max={TEXT_SIZES[TEXT_SIZES.length - 1]}\n step=\"1\"\n value={currentTextSize}\n list=\"sizes\"\n onChange={(e) => {\n const value = parseInt(e.target.value, 10);\n const html = document.documentElement;\n // set CSS variable\n html.style.setProperty('--text-size', `${value}px`);\n // save to local storage\n if (value === DEFAULT_TEXT_SIZE) {\n store.local.del('textSize');\n } else {\n store.local.set('textSize', e.target.value);\n }\n }}\n />{' '}\n <span style={{ fontSize: TEXT_SIZES[TEXT_SIZES.length - 1] }}>\n <Trans comment=\"Preview of one character, in largest size\">\n A\n </Trans>\n </span>\n <datalist id=\"sizes\">\n {TEXT_SIZES.map((size) => (\n <option value={size} />\n ))}\n </datalist>\n </div>\n </li>\n <li>\n <span>\n <label>\n <Trans>Display language</Trans>\n </label>\n <br />\n <small>\n <a\n href=\"https://crowdin.com/project/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Volunteer translations</Trans>\n </a>\n </small>\n </span>\n <LangSelector />\n </li>\n </ul>\n </section>\n {authenticated && (\n <>\n <h3>\n <Trans>Posting</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <div>\n <label for=\"posting-privacy-field\">\n <Trans>Default visibility</Trans>{' '}\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />\n </label>\n </div>\n <div>\n <select\n id=\"posting-privacy-field\"\n value={prefs['posting:default:visibility'] || 'public'}\n onChange={(e) => {\n const { value } = e.target;\n (async () => {\n try {\n await masto.v1.accounts.updateCredentials({\n source: {\n privacy: value,\n },\n });\n setPrefs({\n ...prefs,\n 'posting:default:visibility': value,\n });\n store.account.set('preferences', {\n ...prefs,\n 'posting:default:visibility': value,\n });\n } catch (e) {\n alert(t`Failed to update posting privacy`);\n console.error(e);\n }\n })();\n }}\n >\n <option value=\"public\">\n <Trans>Public</Trans>\n </option>\n <option value=\"unlisted\">\n <Trans>Unlisted</Trans>\n </option>\n <option value=\"private\">\n <Trans>Followers only</Trans>\n </option>\n </select>\n </div>\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />{' '}\n <small>\n <Trans>\n Synced to your instance server's settings.{' '}\n <a\n href={`https://${instance}/`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to your instance ({instance}) for more settings.\n </a>\n </Trans>\n </small>\n </p>\n </>\n )}\n <h3>\n <Trans>Experiments</Trans>\n </h3>\n <section>\n <ul>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.autoRefresh}\n onChange={(e) => {\n states.settings.autoRefresh = e.target.checked;\n }}\n />{' '}\n <Trans>Auto refresh timeline posts</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.boostsCarousel}\n onChange={(e) => {\n states.settings.boostsCarousel = e.target.checked;\n }}\n />{' '}\n <Trans>Boosts carousel</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslation}\n onChange={(e) => {\n const { checked } = e.target;\n states.settings.contentTranslation = checked;\n if (!checked) {\n states.settings.contentTranslationTargetLanguage = null;\n }\n }}\n />{' '}\n <Trans>Post translation</Trans>\n </label>\n <div\n class={`sub-section ${\n !snapStates.settings.contentTranslation\n ? 'more-insignificant'\n : ''\n }`}\n >\n <div>\n <label>\n <Trans>Translate to </Trans>{' '}\n <select\n value={targetLanguage || ''}\n disabled={!snapStates.settings.contentTranslation}\n style={{ width: '10em' }}\n onChange={(e) => {\n states.settings.contentTranslationTargetLanguage =\n e.target.value || null;\n }}\n >\n <option value=\"\">\n <Trans>\n System language ({systemTargetLanguageText})\n </Trans>\n </option>\n <option disabled>──────────</option>\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <option value={lang.code}>\n {showCommon ? `${native} - ${common}` : common}\n </option>\n );\n })}\n </select>\n </label>\n </div>\n <hr />\n <div class=\"checkbox-fieldset\">\n <Plural\n value={\n snapStates.settings.contentTranslationHideLanguages.length\n }\n _0={`Hide \"Translate\" button for:`}\n other={`Hide \"Translate\" button for (#):`}\n />\n <div class=\"checkbox-fields\">\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationHideLanguages.includes(\n lang.code,\n )}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n states.settings.contentTranslationHideLanguages.push(\n lang.code,\n );\n } else {\n states.settings.contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages.filter(\n (code) => code !== lang.code,\n );\n }\n }}\n />{' '}\n {showCommon ? (\n <span>\n {native}{' '}\n <span class=\"insignificant\">- {common}</span>\n </span>\n ) : (\n common\n )}\n </label>\n );\n })}\n </div>\n </div>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: This feature uses external translation services,\n powered by{' '}\n <a\n href=\"https://github.com/cheeaun/lingva-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva API\n </a>{' '}\n &amp;{' '}\n <a\n href=\"https://github.com/thedaviddelta/lingva-translate\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva Translate\n </a>\n .\n </Trans>\n </small>\n </p>\n <hr />\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationAutoInline}\n disabled={!snapStates.settings.contentTranslation}\n onChange={(e) => {\n states.settings.contentTranslationAutoInline =\n e.target.checked;\n }}\n />{' '}\n <Trans>Auto inline translation</Trans>\n </label>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Automatically show translation for posts in timeline.\n Only works for <b>short</b> posts without content\n warning, media and poll.\n </Trans>\n </small>\n </p>\n </div>\n </div>\n </li>\n {!!GIPHY_API_KEY && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.composerGIFPicker}\n onChange={(e) => {\n states.settings.composerGIFPicker = e.target.checked;\n }}\n />{' '}\n <Trans>GIF Picker for composer</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external GIF search service,\n powered by{' '}\n <a\n href=\"https://developers.giphy.com/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GIPHY\n </a>\n . G-rated (suitable for viewing by all ages), tracking\n parameters are stripped, referrer information is omitted\n from requests, but search queries and IP address\n information will still reach their servers.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {!!IMG_ALT_API_URL && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.mediaAltGenerator}\n onChange={(e) => {\n states.settings.mediaAltGenerator = e.target.checked;\n }}\n />{' '}\n <Trans>Image description generator</Trans>{' '}\n <Icon icon=\"sparkles2\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Only for new images while composing new posts.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external AI service, powered by{' '}\n <a\n href=\"https://github.com/cheeaun/img-alt-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n img-alt-api\n </a>\n . May not work well. Only for images and in English.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && supports('@mastodon/grouped-notifications') && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.groupedNotificationsAlpha}\n onChange={(e) => {\n states.settings.groupedNotificationsAlpha =\n e.target.checked;\n }}\n />{' '}\n <Trans>Server-side grouped notifications</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Alpha-stage feature. Potentially improved grouping window\n but basic grouping logic.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={\n snapStates.settings.shortcutSettingsCloudImportExport\n }\n onChange={(e) => {\n states.settings.shortcutSettingsCloudImportExport =\n e.target.checked;\n }}\n />{' '}\n <Trans>\"Cloud\" import/export for shortcuts settings</Trans>{' '}\n <Icon icon=\"cloud\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n ⚠️⚠️⚠️ Very experimental.\n <br />\n Stored in your own profiles notes. Profile (private)\n notes are mainly used for other profiles, and hidden for\n own profile.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses currently-logged-in instance\n server API.\n </Trans>\n </small>\n </div>\n </li>\n )}\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.cloakMode}\n onChange={(e) => {\n states.settings.cloakMode = e.target.checked;\n }}\n />{' '}\n <Trans>\n Cloak mode{' '}\n <span class=\"insignificant\">\n (<samp>Text</samp> → <samp>████</samp>)\n </span>\n </Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Replace text as blocks, useful when taking screenshots, for\n privacy reasons.\n </Trans>\n </small>\n </div>\n </li>\n {authenticated && (\n <li>\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n states.showDrafts = true;\n states.showSettings = false;\n }}\n >\n <Trans>Unsent drafts</Trans>\n </button>\n </li>\n )}\n </ul>\n </section>\n {authenticated && <PushNotificationsSection onClose={onClose} />}\n <h3>\n <Trans>About</Trans>\n </h3>\n <section>\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 8,\n lineHeight: 1.25,\n alignItems: 'center',\n marginTop: 8,\n }}\n >\n <img\n src={logo}\n alt=\"\"\n width=\"64\"\n height=\"64\"\n style={{\n aspectRatio: '1/1',\n verticalAlign: 'middle',\n background: '#b7cdf9',\n borderRadius: 12,\n }}\n />\n <div>\n <b>Phanpy</b>{' '}\n <a\n href=\"https://hachyderm.io/@phanpy\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'phanpy@hachyderm.io';\n }}\n >\n @phanpy\n </a>\n <br />\n <Trans>\n <a\n href=\"https://github.com/cheeaun/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n </Trans>\n </div>\n </div>\n <p>\n <a\n href=\"https://github.com/sponsors/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Sponsor</Trans>\n </a>{' '}\n &middot;{' '}\n <a\n href=\"https://www.buymeacoffee.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Donate</Trans>\n </a>{' '}\n &middot;{' '}\n <a\n href=\"https://patreon.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Patreon\n </a>{' '}\n &middot;{' '}\n <a\n href={PRIVACY_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Privacy Policy</Trans>\n </a>\n </p>\n {__BUILD_TIME__ && (\n <p>\n {WEBSITE && (\n <>\n <Trans>\n <span class=\"insignificant\">Site:</span>{' '}\n {WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')}\n </Trans>\n <br />\n </>\n )}\n <Trans>\n <span class=\"insignificant\">Version:</span>{' '}\n <input\n type=\"text\"\n class=\"version-string\"\n readOnly\n size=\"18\" // Manually calculated here\n value={`${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`}\n onClick={(e) => {\n e.target.select();\n // Copy to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Version string copied`);\n } catch (e) {\n console.warn(e);\n showToast(t`Unable to copy version string`);\n }\n }}\n />{' '}\n {!__FAKE_COMMIT_HASH__ && (\n <span class=\"ib insignificant\">\n (\n <a\n href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <RelativeTime datetime={new Date(__BUILD_TIME__)} />\n </a>\n )\n </span>\n )}\n </Trans>\n </p>\n )}\n </section>\n {(import.meta.env.DEV || import.meta.env.PHANPY_DEV) && (\n <details class=\"debug-info\">\n <summary></summary>\n <p>Debugging</p>\n {__BENCH_RESULTS?.size > 0 && (\n <ul>\n {Array.from(__BENCH_RESULTS.entries()).map(\n ([name, duration]) => (\n <li>\n <b>{name}</b>: {duration}ms\n </li>\n ),\n )}\n </ul>\n )}\n <p>Service Worker Cache</p>\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={async () => alert(await getCachesKeys())}\n >\n Show keys count\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={async () => alert(await getCachesSize())}\n >\n Show cache size\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n const key = prompt('Enter cache key');\n if (!key) return;\n try {\n clearCacheKey(key);\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear cache key\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n try {\n clearCaches();\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear all caches\n </button>\n </details>\n )}\n </main>\n </div>\n );\n}\n\nasync function getCachesKeys() {\n const keys = await caches.keys();\n const total = {};\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n total[key] = k.length;\n }\n return total;\n}\n\nasync function getCachesSize() {\n const keys = await caches.keys();\n let total = {};\n let TOTAL = 0;\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n for (const item of k) {\n try {\n const response = await cache.match(item);\n const blob = await response.blob();\n total[key] = (total[key] || 0) + blob.size;\n TOTAL += blob.size;\n } catch (e) {\n alert('Failed to get cache size for ' + item);\n alert(e);\n }\n }\n }\n return {\n ...Object.fromEntries(\n Object.entries(total).map(([k, v]) => [k, prettyBytes(v)]),\n ),\n TOTAL: prettyBytes(TOTAL),\n };\n}\n\nfunction clearCacheKey(key) {\n return caches.delete(key);\n}\n\nasync function clearCaches() {\n const keys = await caches.keys();\n for (const key of keys) {\n await caches.delete(key);\n }\n}\n\nfunction PushNotificationsSection({ onClose }) {\n if (!isPushSupported()) return null;\n\n const { instance } = api();\n const [uiState, setUIState] = useState('default');\n const pushFormRef = useRef();\n const [allowNotifications, setAllowNotifications] = useState(false);\n const [needRelogin, setNeedRelogin] = useState(false);\n const previousPolicyRef = useRef();\n useEffect(() => {\n (async () => {\n setUIState('loading');\n try {\n const { subscription, backendSubscription } = await initSubscription();\n if (\n backendSubscription?.policy &&\n backendSubscription.policy !== 'none'\n ) {\n setAllowNotifications(true);\n const { alerts, policy } = backendSubscription;\n console.log('backendSubscription', backendSubscription);\n previousPolicyRef.current = policy;\n const { elements } = pushFormRef.current;\n const policyEl = elements.namedItem('policy');\n if (policyEl) policyEl.value = policy;\n // alerts is {}, iterate it\n Object.keys(alerts).forEach((alert) => {\n const el = elements.namedItem(alert);\n if (el?.type === 'checkbox') {\n el.checked = true;\n }\n });\n }\n setUIState('default');\n } catch (err) {\n console.warn(err);\n if (/outside.*authorized/i.test(err.message)) {\n setNeedRelogin(true);\n } else {\n alert(err?.message || err);\n }\n setUIState('error');\n }\n })();\n }, []);\n\n const isLoading = uiState === 'loading';\n\n return (\n <form\n ref={pushFormRef}\n onChange={() => {\n setTimeout(() => {\n const values = Object.fromEntries(new FormData(pushFormRef.current));\n const allowNotifications = !!values['policy-allow'];\n const params = {\n data: {\n policy: values.policy,\n alerts: {\n mention: !!values.mention,\n favourite: !!values.favourite,\n reblog: !!values.reblog,\n follow: !!values.follow,\n follow_request: !!values.followRequest,\n poll: !!values.poll,\n update: !!values.update,\n status: !!values.status,\n },\n },\n };\n\n let alertsCount = 0;\n // Remove false values from data.alerts\n // API defaults to false anyway\n Object.keys(params.data.alerts).forEach((key) => {\n if (!params.data.alerts[key]) {\n delete params.data.alerts[key];\n } else {\n alertsCount++;\n }\n });\n const policyChanged =\n previousPolicyRef.current !== params.data.policy;\n\n console.log('PN Form', {\n values,\n allowNotifications: allowNotifications,\n params,\n });\n\n if (allowNotifications && alertsCount > 0) {\n if (policyChanged) {\n console.debug('Policy changed.');\n removeSubscription()\n .then(() => {\n updateSubscription(params);\n })\n .catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n } else {\n updateSubscription(params).catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n }\n } else {\n removeSubscription().catch((err) => {\n console.warn(err);\n alert(t`Failed to remove subscription. Please try again.`);\n });\n }\n }, 100);\n }}\n >\n <h3>\n <Trans>Push Notifications (beta)</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <label>\n <input\n type=\"checkbox\"\n disabled={isLoading || needRelogin}\n name=\"policy-allow\"\n checked={allowNotifications}\n onChange={async (e) => {\n const { checked } = e.target;\n if (checked) {\n // Request permission\n const permission = await Notification.requestPermission();\n if (permission === 'granted') {\n setAllowNotifications(true);\n } else {\n setAllowNotifications(false);\n if (permission === 'denied') {\n alert(\n t`Push notifications are blocked. Please enable them in your browser settings.`,\n );\n }\n }\n } else {\n setAllowNotifications(false);\n }\n }}\n />{' '}\n <Trans>\n Allow from{' '}\n <select\n name=\"policy\"\n disabled={isLoading || needRelogin || !allowNotifications}\n >\n {[\n {\n value: 'all',\n label: t`anyone`,\n },\n {\n value: 'followed',\n label: t`people I follow`,\n },\n {\n value: 'follower',\n label: t`followers`,\n },\n ].map((type) => (\n <option value={type.value}>{type.label}</option>\n ))}\n </select>\n </Trans>\n </label>\n <div\n class=\"shazam-container no-animation\"\n style={{\n width: '100%',\n }}\n hidden={!allowNotifications}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"sub-section\">\n <ul>\n {[\n {\n value: 'mention',\n label: t`Mentions`,\n },\n {\n value: 'favourite',\n label: t`Likes`,\n },\n {\n value: 'reblog',\n label: t`Boosts`,\n },\n {\n value: 'follow',\n label: t`Follows`,\n },\n {\n value: 'followRequest',\n label: t`Follow requests`,\n },\n {\n value: 'poll',\n label: t`Polls`,\n },\n {\n value: 'update',\n label: t`Post edits`,\n },\n {\n value: 'status',\n label: t`New posts`,\n },\n ].map((alert) => (\n <li>\n <label>\n <input type=\"checkbox\" name={alert.value} />{' '}\n {alert.label}\n </label>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n {needRelogin && (\n <div class=\"sub-section\">\n <p>\n <Trans>\n Push permission was not granted since your last login.\n You'll need to{' '}\n <Link to={`/login?instance=${instance}`} onClick={onClose}>\n <b>log in</b> again to grant push permission\n </Link>\n .\n </Trans>\n </p>\n </div>\n )}\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <small>\n <Trans>\n NOTE: Push notifications only work for <b>one account</b>.\n </Trans>\n </small>\n </p>\n </form>\n );\n}\n\nexport default Settings;\n","const focusDeck = () => {\n let timer = setTimeout(() => {\n const columns = document.getElementById('columns');\n if (columns) {\n // Focus focused column\n const focusedColumn = columns.querySelector('.deck-container.focus');\n if (focusedColumn) {\n focusedColumn.focus();\n } else {\n // Focus first column within viewport\n const firstVisibleColumn = columns\n .querySelectorAll('.deck-container')\n .find((column) => {\n const columnRect = column.getBoundingClientRect();\n return columnRect.left >= 0;\n });\n if (firstVisibleColumn) {\n firstVisibleColumn.focus();\n } else {\n // Focus first column\n columns.querySelector('.deck-container')?.focus?.();\n }\n }\n } else {\n const modals = document.querySelectorAll('#modal-container > *');\n if (modals?.length) {\n // Focus last modal\n const modal = modals[modals.length - 1]; // last one\n const modalFocusElement =\n modal.querySelector('[tabindex=\"-1\"]') || modal;\n if (modalFocusElement) {\n modalFocusElement.focus();\n return;\n }\n }\n const backDrop = document.querySelector('.deck-backdrop');\n if (backDrop) return;\n // Focus last deck\n const pages = document.querySelectorAll('.deck-container');\n const page = pages[pages.length - 1]; // last one\n if (page && page.tabIndex === -1) {\n console.log('FOCUS', page);\n page.focus();\n }\n }\n }, 100);\n return () => clearTimeout(timer);\n};\n\nexport default focusDeck;\n","import { useEffect, useRef } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\n// Hook that runs a callback when the location changes\n// Won't run on the first render\n\nexport default function useLocationChange(fn) {\n if (!fn) return;\n const location = useLocation();\n const currentLocationRef = useRef(location.pathname);\n useEffect(() => {\n // console.log('location', {\n // current: currentLocationRef.current,\n // next: location.pathname,\n // });\n if (\n currentLocationRef.current &&\n location.pathname !== currentLocationRef.current\n ) {\n fn?.();\n }\n }, [location.pathname, fn]);\n}\n","import { api } from './api';\nimport pmem from './pmem';\nimport store from './store';\n\nconst FETCH_MAX_AGE = 1000 * 60; // 1 minute\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\n\nexport const fetchLists = pmem(\n async () => {\n const { masto } = api();\n const lists = await masto.v1.lists.list();\n lists.sort((a, b) => a.title.localeCompare(b.title));\n\n if (lists.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return lists;\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getLists() {\n try {\n const { lists, updatedAt } = store.account.get('lists') || {};\n if (!lists?.length) return await fetchLists();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchLists();\n return lists;\n }\n return lists;\n } catch (e) {\n return [];\n }\n}\n\nexport const fetchList = pmem(\n (id) => {\n const { masto } = api();\n return masto.v1.lists.$select(id).fetch();\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getList(id) {\n const { lists } = store.account.get('lists') || {};\n console.log({ lists });\n if (lists?.length) {\n const theList = lists.find((l) => l.id === id);\n if (theList) return theList;\n }\n try {\n return fetchList(id);\n } catch (e) {\n return null;\n }\n}\n\nexport async function getListTitle(id) {\n const list = await getList(id);\n return list?.title || '';\n}\n\nexport function addListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n lists.push(list);\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n}\n\nexport function updateListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === list.id);\n if (index !== -1) {\n lists[index] = list;\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n\nexport function deleteListStore(listID) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === listID);\n if (index !== -1) {\n lists.splice(index, 1);\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport { addListStore, deleteListStore, updateListStore } from '../utils/lists';\nimport supports from '../utils/supports';\n\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\n\nfunction ListAddEdit({ list, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!list;\n const nameFieldRef = useRef();\n const repliesPolicyFieldRef = useRef();\n const exclusiveFieldRef = useRef();\n useEffect(() => {\n if (editMode) {\n nameFieldRef.current.value = list.title;\n repliesPolicyFieldRef.current.value = list.repliesPolicy;\n if (exclusiveFieldRef.current) {\n exclusiveFieldRef.current.checked = list.exclusive;\n }\n }\n }, [editMode]);\n const supportsExclusive =\n supports('@mastodon/list-exclusive') ||\n supports('@gotosocial/list-exclusive');\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}{' '}\n <header>\n <h2>{editMode ? t`Edit list` : t`New list`}</h2>\n </header>\n <main>\n <form\n class=\"list-form\"\n onSubmit={(e) => {\n e.preventDefault(); // Get form values\n\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const repliesPolicy = formData.get('replies_policy');\n const exclusive = formData.get('exclusive') === 'on';\n console.log({\n title,\n repliesPolicy,\n exclusive,\n });\n setUIState('loading');\n\n (async () => {\n try {\n let listResult;\n\n if (editMode) {\n listResult = await masto.v1.lists.$select(list.id).update({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n } else {\n listResult = await masto.v1.lists.create({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n }\n\n console.log(listResult);\n setUIState('default');\n onClose?.({\n state: 'success',\n list: listResult,\n });\n\n setTimeout(() => {\n if (editMode) {\n updateListStore(listResult);\n } else {\n addListStore(listResult);\n }\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit list.`\n : t`Unable to create list.`,\n );\n }\n })();\n }}\n >\n <div class=\"list-form-row\">\n <label for=\"list-title\">\n <Trans>Name</Trans>{' '}\n <input\n ref={nameFieldRef}\n type=\"text\"\n id=\"list-title\"\n name=\"title\"\n required\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </div>\n <div class=\"list-form-row\">\n <select\n ref={repliesPolicyFieldRef}\n name=\"replies_policy\"\n required\n disabled={uiState === 'loading'}\n >\n <option value=\"list\">\n <Trans>Show replies to list members</Trans>\n </option>\n <option value=\"followed\">\n <Trans>Show replies to people I follow</Trans>\n </option>\n <option value=\"none\">\n <Trans>Don't show replies</Trans>\n </option>\n </select>\n </div>\n {supportsExclusive && (\n <div class=\"list-form-row\">\n <label class=\"label-block\">\n <input\n ref={exclusiveFieldRef}\n type=\"checkbox\"\n name=\"exclusive\"\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Hide posts on this list from Home/Following</Trans>\n </label>\n </div>\n )}\n <div class=\"list-form-footer\">\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this list?`}\n onClick={() => {\n // const yes = confirm('Delete this list?');\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(list.id).remove();\n setUIState('default');\n onClose?.({\n state: 'deleted',\n });\n setTimeout(() => {\n deleteListStore(list.id);\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete list.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </div>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ListAddEdit;\n","import './account-info.css';\n\nimport { msg, plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\n\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport i18nDuration from '../utils/i18n-duration';\nimport { getLists } from '../utils/lists';\nimport niceDateTime from '../utils/nice-date-time';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport states, { hideAllModals } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, updateAccount } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport AccountBlock from './account-block';\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport Link from './link';\nimport ListAddEdit from './list-add-edit';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport Modal from './modal';\nimport SubMenu2 from './submenu2';\nimport TranslationBlock from './translation-block';\n\nconst MUTE_DURATIONS = [\n 60 * 5, // 5 minutes\n 60 * 30, // 30 minutes\n 60 * 60, // 1 hour\n 60 * 60 * 6, // 6 hours\n 60 * 60 * 24, // 1 day\n 60 * 60 * 24 * 3, // 3 days\n 60 * 60 * 24 * 7, // 1 week\n 60 * 60 * 24 * 30, // 30 days\n 0, // forever\n];\nconst MUTE_DURATIONS_LABELS = {\n 0: msg`Forever`,\n 300: i18nDuration(5, 'minute'),\n 1_800: i18nDuration(30, 'minute'),\n 3_600: i18nDuration(1, 'hour'),\n 21_600: i18nDuration(6, 'hour'),\n 86_400: i18nDuration(1, 'day'),\n 259_200: i18nDuration(3, 'day'),\n 604_800: i18nDuration(1, 'week'),\n 2592_000: i18nDuration(30, 'day'),\n};\n\nconst LIMIT = 80;\n\nconst ACCOUNT_INFO_MAX_AGE = 1000 * 60 * 10; // 10 mins\n\nfunction fetchFamiliarFollowers(currentID, masto) {\n return masto.v1.accounts.familiarFollowers.fetch({\n id: [currentID],\n });\n}\nconst memFetchFamiliarFollowers = pmem(fetchFamiliarFollowers, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nasync function fetchPostingStats(accountID, masto) {\n const fetchStatuses = masto.v1.accounts\n .$select(accountID)\n .statuses.list({\n limit: 20,\n })\n .next();\n\n const { value: statuses } = await fetchStatuses;\n console.log('fetched statuses', statuses);\n const stats = {\n total: statuses.length,\n originals: 0,\n replies: 0,\n boosts: 0,\n };\n // Categories statuses by type\n // - Original posts (not replies to others)\n // - Threads (self-replies + 1st original post)\n // - Boosts (reblogs)\n // - Replies (not-self replies)\n statuses.forEach((status) => {\n if (status.reblog) {\n stats.boosts++;\n } else if (\n !!status.inReplyToId &&\n status.inReplyToAccountId !== status.account.id // Not self-reply\n ) {\n stats.replies++;\n } else {\n stats.originals++;\n }\n });\n\n // Count days since last post\n if (statuses.length) {\n stats.daysSinceLastPost = Math.ceil(\n (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) /\n 86400000,\n );\n }\n\n console.log('posting stats', stats);\n return stats;\n}\nconst memFetchPostingStats = pmem(fetchPostingStats, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nfunction AccountInfo({\n account,\n fetchAccount = () => {},\n standalone,\n instance,\n authenticated,\n}) {\n const { i18n } = useLingui();\n const { masto } = api({\n instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const [uiState, setUIState] = useState('default');\n const isString = typeof account === 'string';\n const [info, setInfo] = useState(isString ? null : account);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n\n useEffect(() => {\n if (!isString) {\n setInfo(account);\n return;\n }\n setUIState('loading');\n (async () => {\n try {\n const info = await fetchAccount();\n states.accounts[`${info.id}@${instance}`] = info;\n setInfo(info);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setInfo(null);\n setUIState('error');\n }\n })();\n }, [isString, account, fetchAccount]);\n\n const {\n acct,\n avatar,\n avatarStatic,\n bot,\n createdAt,\n displayName,\n emojis,\n fields,\n followersCount,\n followingCount,\n group,\n // header,\n // headerStatic,\n id,\n lastStatusAt,\n locked,\n note,\n statusesCount,\n url,\n username,\n memorial,\n moved,\n roles,\n hideCollections,\n } = info || {};\n let headerIsAvatar = false;\n let { header, headerStatic } = info || {};\n if (!header || /missing\\.png$/.test(header)) {\n if (avatar && !/missing\\.png$/.test(avatar)) {\n header = avatar;\n headerIsAvatar = true;\n if (avatarStatic && !/missing\\.png$/.test(avatarStatic)) {\n headerStatic = avatarStatic;\n }\n }\n }\n\n const isSelf = useMemo(() => id === getCurrentAccountID(), [id]);\n\n useEffect(() => {\n const infoHasEssentials = !!(\n info?.id &&\n info?.username &&\n info?.acct &&\n info?.avatar &&\n info?.avatarStatic &&\n info?.displayName &&\n info?.url\n );\n if (isSelf && instance && infoHasEssentials) {\n const accounts = store.local.getJSON('accounts');\n let updated = false;\n accounts.forEach((account) => {\n if (account.info.id === info.id && account.instanceURL === instance) {\n account.info = info;\n updated = true;\n }\n });\n if (updated) {\n console.log('Updated account info', info);\n store.local.setJSON('accounts', accounts);\n }\n }\n }, [isSelf, info, instance]);\n\n const accountInstance = useMemo(() => {\n if (!url) return null;\n const domain = punycode.toUnicode(URL.parse(url).hostname);\n return domain;\n }, [url]);\n\n const [headerCornerColors, setHeaderCornerColors] = useState([]);\n\n const followersIterator = useRef();\n const familiarFollowersCache = useRef([]);\n async function fetchFollowers(firstLoad) {\n if (firstLoad || !followersIterator.current) {\n followersIterator.current = masto.v1.accounts.$select(id).followers.list({\n limit: LIMIT,\n });\n }\n const results = await followersIterator.current.next();\n if (isSelf) return results;\n if (!sameCurrentInstance) return results;\n\n const { value } = results;\n let newValue = [];\n // On first load, fetch familiar followers, merge to top of results' `value`\n // Remove dups on every fetch\n if (firstLoad) {\n let familiarFollowers = [];\n try {\n familiarFollowers = await masto.v1.accounts.familiarFollowers.fetch({\n id: [id],\n });\n } catch (e) {}\n familiarFollowersCache.current = familiarFollowers?.[0]?.accounts || [];\n newValue = [\n ...familiarFollowersCache.current,\n ...value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n ),\n ];\n } else if (value?.length) {\n newValue = value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n );\n }\n\n return {\n ...results,\n value: newValue,\n };\n }\n\n const followingIterator = useRef();\n async function fetchFollowing(firstLoad) {\n if (firstLoad || !followingIterator.current) {\n followingIterator.current = masto.v1.accounts.$select(id).following.list({\n limit: LIMIT,\n });\n }\n const results = await followingIterator.current.next();\n return results;\n }\n\n const LinkOrDiv = standalone ? 'div' : Link;\n const accountLink = instance ? `/${instance}/a/${id}` : `/a/${id}`;\n\n const [familiarFollowers, setFamiliarFollowers] = useState([]);\n const [postingStats, setPostingStats] = useState();\n const [postingStatsUIState, setPostingStatsUIState] = useState('default');\n const hasPostingStats = !!postingStats?.total;\n\n const renderFamiliarFollowers = async (currentID) => {\n try {\n const followers = await memFetchFamiliarFollowers(\n currentID,\n currentMasto,\n );\n console.log('fetched familiar followers', followers);\n setFamiliarFollowers(\n followers[0].accounts.slice(0, FAMILIAR_FOLLOWERS_LIMIT),\n );\n } catch (e) {\n console.error(e);\n }\n };\n\n const renderPostingStats = async () => {\n if (!id) return;\n setPostingStatsUIState('loading');\n try {\n const stats = await memFetchPostingStats(id, masto);\n setPostingStats(stats);\n setPostingStatsUIState('default');\n } catch (e) {\n console.error(e);\n setPostingStatsUIState('error');\n }\n };\n\n const onRelationshipChange = useCallback(\n ({ relationship, currentID }) => {\n if (!relationship.following) {\n renderFamiliarFollowers(currentID);\n if (!standalone && statusesCount > 0) {\n // Only render posting stats if not standalone and has posts\n renderPostingStats();\n }\n }\n },\n [standalone, id, statusesCount],\n );\n\n const onProfileUpdate = useCallback(\n (newAccount) => {\n if (newAccount.id === id) {\n console.log('Updated account info', newAccount);\n setInfo(newAccount);\n states.accounts[`${newAccount.id}@${instance}`] = newAccount;\n }\n },\n [id, instance],\n );\n\n return (\n <div\n tabIndex=\"-1\"\n class={`account-container ${uiState === 'loading' ? 'skeleton' : ''}`}\n style={{\n '--header-color-1': headerCornerColors[0],\n '--header-color-2': headerCornerColors[1],\n '--header-color-3': headerCornerColors[2],\n '--header-color-4': headerCornerColors[3],\n }}\n >\n {uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to load account.</Trans>\n </p>\n <p>\n <a\n href={isString ? account : url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Go to account page</Trans> <Icon icon=\"external\" />\n </a>\n </p>\n </div>\n )}\n {uiState === 'loading' ? (\n <>\n <header>\n <AccountBlock avatarSize=\"xxxl\" skeleton />\n </header>\n <main>\n <div class=\"note\">\n <p>███████ ████ ████</p>\n <p>████ ████████ ██████ █████████ ████ ██</p>\n </div>\n <div class=\"account-metadata-box\">\n <div class=\"profile-metadata\">\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">███</b>\n <p>██████</p>\n </div>\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">████</b>\n <p>███████████</p>\n </div>\n </div>\n <div class=\"stats\">\n <div>\n <span>██</span> <Trans>Followers</Trans>\n </div>\n <div>\n <span>██</span> <Trans id=\"following.stats\">Following</Trans>\n </div>\n <div>\n <span>██</span> <Trans>Posts</Trans>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <span />\n <span class=\"buttons\">\n <button type=\"button\" class=\"plain\" disabled>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n </span>\n </div>\n </main>\n </>\n ) : (\n info && (\n <>\n {!!moved && (\n <div class=\"account-moved\">\n <p>\n <Trans>\n <b>{displayName}</b> has indicated that their new account is\n now:\n </Trans>\n </p>\n <AccountBlock\n account={moved}\n instance={instance}\n onClick={(e) => {\n e.stopPropagation();\n states.showAccount = moved;\n }}\n />\n </div>\n )}\n {!!header && !/missing\\.png$/.test(header) && (\n <img\n src={header}\n alt=\"\"\n class={`header-banner ${\n headerIsAvatar ? 'header-is-avatar' : ''\n }`}\n onError={(e) => {\n if (e.target.crossOrigin) {\n if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.removeAttribute('crossorigin');\n e.target.src = header;\n }\n } else if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.remove();\n }\n }}\n crossOrigin=\"anonymous\"\n onLoad={(e) => {\n e.target.classList.add('loaded');\n try {\n // Get color from four corners of image\n const canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n canvas.width = e.target.width;\n canvas.height = e.target.height;\n ctx.imageSmoothingEnabled = false;\n ctx.drawImage(e.target, 0, 0);\n // const colors = [\n // ctx.getImageData(0, 0, 1, 1).data,\n // ctx.getImageData(e.target.width - 1, 0, 1, 1).data,\n // ctx.getImageData(0, e.target.height - 1, 1, 1).data,\n // ctx.getImageData(\n // e.target.width - 1,\n // e.target.height - 1,\n // 1,\n // 1,\n // ).data,\n // ];\n // Get 10x10 pixels from corners, get average color from each\n const pixelDimension = 10;\n const colors = [\n ctx.getImageData(0, 0, pixelDimension, pixelDimension)\n .data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n 0,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n 0,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ].map((data) => {\n let r = 0;\n let g = 0;\n let b = 0;\n let a = 0;\n for (let i = 0; i < data.length; i += 4) {\n r += data[i];\n g += data[i + 1];\n b += data[i + 2];\n a += data[i + 3];\n }\n const dataLength = data.length / 4;\n return [\n r / dataLength,\n g / dataLength,\n b / dataLength,\n a / dataLength,\n ];\n });\n const rgbColors = colors.map((color) => {\n const [r, g, b, a] = lightenRGB(color);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n });\n setHeaderCornerColors(rgbColors);\n console.log({ colors, rgbColors });\n } catch (e) {\n // Silently fail\n }\n }}\n />\n )}\n <header>\n {standalone ? (\n <Menu2\n shift={\n window.matchMedia('(min-width: calc(40em))').matches\n ? 114\n : 64\n }\n menuButton={\n <div>\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n onClick={() => {}}\n />\n </div>\n }\n >\n <div class=\"szh-menu__header\">\n <AccountHandleInfo acct={acct} instance={instance} />\n </div>\n <MenuItem\n onClick={() => {\n const handleWithInstance = acct.includes('@')\n ? `@${acct}`\n : `@${acct}@${instance}`;\n try {\n navigator.clipboard.writeText(handleWithInstance);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy handle</Trans>\n </span>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <span>\n <Trans>Go to original profile page</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuLink href={info.avatar} target=\"_blank\">\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile image</Trans>\n </span>\n </MenuLink>\n <MenuLink href={info.header} target=\"_blank\">\n <Icon icon=\"media\" />\n <span>\n <Trans>View profile header</Trans>\n </span>\n </MenuLink>\n </Menu2>\n ) : (\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n internal\n />\n )}\n </header>\n <div class=\"faux-header-bg\" aria-hidden=\"true\" />\n <main>\n {!!memorial && (\n <span class=\"tag\">\n <Trans>In Memoriam</Trans>\n </span>\n )}\n {!!bot && (\n <span class=\"tag\">\n <Icon icon=\"bot\" /> <Trans>Automated</Trans>\n </span>\n )}\n {!!group && (\n <span class=\"tag\">\n <Icon icon=\"group\" /> <Trans>Group</Trans>\n </span>\n )}\n {roles?.map((role) => (\n <span class=\"tag\">\n {role.name}\n {!!accountInstance && (\n <>\n {' '}\n <span class=\"more-insignificant\">{accountInstance}</span>\n </>\n )}\n </span>\n ))}\n <div\n class=\"note\"\n dir=\"auto\"\n onClick={handleContentLinks({\n instance: currentInstance,\n })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(note, { emojis }),\n }}\n />\n <div class=\"account-metadata-box\">\n {fields?.length > 0 && (\n <div class=\"profile-metadata\">\n {fields.map(({ name, value, verifiedAt }, i) => (\n <div\n class={`profile-field ${\n verifiedAt ? 'profile-verified' : ''\n }`}\n key={name + i}\n dir=\"auto\"\n >\n <b>\n <EmojiText text={name} emojis={emojis} />{' '}\n {!!verifiedAt && (\n <Icon\n icon=\"check-circle\"\n size=\"s\"\n alt={t`Verified`}\n />\n )}\n </b>\n <p\n dangerouslySetInnerHTML={{\n __html: enhanceContent(value, { emojis }),\n }}\n />\n </div>\n ))}\n </div>\n )}\n <div class=\"stats\">\n <LinkOrDiv\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n id: 'followers',\n heading: t`Followers`,\n fetchAccounts: fetchFollowers,\n instance,\n excludeRelationshipAttrs: isSelf\n ? ['followedBy']\n : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n {!!familiarFollowers.length && (\n <span class=\"shazam-container-horizontal\">\n <span class=\"shazam-container-inner stats-avatars-bunch\">\n {familiarFollowers.map((follower) => (\n <Avatar\n url={follower.avatarStatic}\n size=\"s\"\n alt={`${follower.displayName} @${follower.acct}`}\n squircle={follower?.bot}\n />\n ))}\n </span>\n </span>\n )}\n <span title={followersCount}>\n {shortenNumber(followersCount)}\n </span>{' '}\n <Trans>Followers</Trans>\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n heading: t({\n id: 'following.stats',\n message: 'Following',\n }),\n fetchAccounts: fetchFollowing,\n instance,\n excludeRelationshipAttrs: isSelf ? ['following'] : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n <span title={followingCount}>\n {shortenNumber(followingCount)}\n </span>{' '}\n <Trans id=\"following.stats\">Following</Trans>\n <br />\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n to={accountLink}\n // onClick={\n // standalone\n // ? undefined\n // : () => {\n // hideAllModals();\n // }\n // }\n >\n <span title={statusesCount}>\n {shortenNumber(statusesCount)}\n </span>{' '}\n <Trans>Posts</Trans>\n </LinkOrDiv>\n {!!createdAt && (\n <div class=\"insignificant\">\n <Trans>\n Joined{' '}\n <time datetime={createdAt}>\n {niceDateTime(createdAt, {\n hideTime: true,\n })}\n </time>\n </Trans>\n </div>\n )}\n </div>\n </div>\n {!!postingStats && (\n <LinkOrDiv\n to={accountLink}\n class=\"account-metadata-box\"\n // onClick={() => {\n // states.showAccount = false;\n // }}\n >\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n {hasPostingStats ? (\n <div\n class=\"posting-stats\"\n title={t`${(\n postingStats.originals / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} original posts, ${(\n postingStats.replies / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} replies, ${(\n postingStats.boosts / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} boosts`}\n >\n <div>\n {postingStats.daysSinceLastPost < 365\n ? plural(postingStats.total, {\n one: plural(postingStats.daysSinceLastPost, {\n one: `Last 1 post in the past 1 day`,\n other: `Last 1 post in the past ${postingStats.daysSinceLastPost} days`,\n }),\n other: plural(\n postingStats.daysSinceLastPost,\n {\n one: `Last ${postingStats.total} posts in the past 1 day`,\n other: `Last ${postingStats.total} posts in the past ${postingStats.daysSinceLastPost} days`,\n },\n ),\n })\n : plural(postingStats.total, {\n one: 'Last 1 post in the past year(s)',\n other: `Last ${postingStats.total} posts in the past year(s)`,\n })}\n </div>\n <div\n class=\"posting-stats-bar\"\n style={{\n // [originals | replies | boosts]\n '--originals-percentage': `${\n (postingStats.originals / postingStats.total) *\n 100\n }%`,\n '--replies-percentage': `${\n ((postingStats.originals +\n postingStats.replies) /\n postingStats.total) *\n 100\n }%`,\n }}\n />\n <div class=\"posting-stats-legends\">\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-originals\" />{' '}\n <Trans>Original</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-replies\" />{' '}\n <Trans>Replies</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-boosts\" />{' '}\n <Trans>Boosts</Trans>\n </span>\n </div>\n </div>\n ) : (\n <div class=\"posting-stats\">\n <Trans>Post stats unavailable.</Trans>\n </div>\n )}\n </div>\n </div>\n </LinkOrDiv>\n )}\n {!moved && (\n <div class=\"account-metadata-box\">\n <div\n class=\"shazam-container no-animation\"\n hidden={!!postingStats}\n >\n <div class=\"shazam-container-inner\">\n <button\n type=\"button\"\n class=\"posting-stats-button\"\n disabled={postingStatsUIState === 'loading'}\n onClick={() => {\n renderPostingStats();\n }}\n >\n <div\n class={`posting-stats-bar posting-stats-icon ${\n postingStatsUIState === 'loading' ? 'loading' : ''\n }`}\n style={{\n '--originals-percentage': '33%',\n '--replies-percentage': '66%',\n }}\n />\n <Trans>View post stats</Trans>{' '}\n {/* <Loader\n abrupt\n hidden={postingStatsUIState !== 'loading'}\n /> */}\n </button>\n </div>\n </div>\n </div>\n )}\n </main>\n <footer>\n <RelatedActions\n info={info}\n instance={instance}\n standalone={standalone}\n authenticated={authenticated}\n onRelationshipChange={onRelationshipChange}\n onProfileUpdate={onProfileUpdate}\n />\n </footer>\n </>\n )\n )}\n </div>\n );\n}\n\nconst FAMILIAR_FOLLOWERS_LIMIT = 3;\n\nfunction RelatedActions({\n info,\n instance,\n standalone,\n authenticated,\n onRelationshipChange = () => {},\n onProfileUpdate = () => {},\n}) {\n if (!info) return null;\n const { _ } = useLingui();\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n\n const [relationshipUIState, setRelationshipUIState] = useState('default');\n const [relationship, setRelationship] = useState(null);\n\n const { id, acct, url, username, locked, lastStatusAt, note, fields, moved } =\n info;\n const accountID = useRef(id);\n\n const {\n following,\n showingReblogs,\n notifying,\n followedBy,\n blocking,\n blockedBy,\n muting,\n mutingNotifications,\n requested,\n domainBlocking,\n endorsed,\n note: privateNote,\n } = relationship || {};\n\n const [currentInfo, setCurrentInfo] = useState(null);\n const [isSelf, setIsSelf] = useState(false);\n\n const acctWithInstance = acct.includes('@') ? acct : `${acct}@${instance}`;\n\n useEffect(() => {\n if (info) {\n const currentAccount = getCurrentAccountID();\n let currentID;\n (async () => {\n if (sameInstance && authenticated) {\n currentID = id;\n } else if (!sameInstance && currentAuthenticated) {\n // Grab this account from my logged-in instance\n const acctHasInstance = info.acct.includes('@');\n try {\n const results = await currentMasto.v2.search.fetch({\n q: acctHasInstance ? info.acct : `${info.username}@${instance}`,\n type: 'accounts',\n limit: 1,\n resolve: true,\n });\n console.log('🥏 Fetched account from logged-in instance', results);\n if (results.accounts.length) {\n currentID = results.accounts[0].id;\n setCurrentInfo(results.accounts[0]);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n if (!currentID) return;\n\n if (currentAccount === currentID) {\n // It's myself!\n setIsSelf(true);\n return;\n }\n\n accountID.current = currentID;\n\n // if (moved) return;\n\n setRelationshipUIState('loading');\n\n const fetchRelationships = currentMasto.v1.accounts.relationships.fetch(\n {\n id: [currentID],\n },\n );\n\n try {\n const relationships = await fetchRelationships;\n console.log('fetched relationship', relationships);\n setRelationshipUIState('default');\n\n if (relationships.length) {\n const relationship = relationships[0];\n setRelationship(relationship);\n onRelationshipChange({ relationship, currentID });\n }\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }\n }, [info, authenticated]);\n\n useEffect(() => {\n if (info && isSelf) {\n updateAccount(info);\n }\n }, [info, isSelf]);\n\n const loading = relationshipUIState === 'loading';\n\n const [showTranslatedBio, setShowTranslatedBio] = useState(false);\n const [showAddRemoveLists, setShowAddRemoveLists] = useState(false);\n const [showPrivateNoteModal, setShowPrivateNoteModal] = useState(false);\n const [showEditProfile, setShowEditProfile] = useState(false);\n const [lists, setLists] = useState([]);\n\n return (\n <>\n <div class=\"actions\">\n <span>\n {followedBy ? (\n <span class=\"tag\">\n <Trans>Follows you</Trans>\n </span>\n ) : !!lastStatusAt ? (\n <small class=\"insignificant\">\n <Trans>\n Last post:{' '}\n <span class=\"ib\">\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n </span>\n </Trans>\n </small>\n ) : (\n <span />\n )}\n {muting && (\n <span class=\"tag danger\">\n <Trans>Muted</Trans>\n </span>\n )}\n {blocking && (\n <span class=\"tag danger\">\n <Trans>Blocked</Trans>\n </span>\n )}\n </span>{' '}\n <span class=\"buttons\">\n {!!privateNote && (\n <button\n type=\"button\"\n class=\"private-note-tag\"\n title={t`Private note`}\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n dir=\"auto\"\n >\n <span>{privateNote}</span>\n </button>\n )}\n <Menu2\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n }}\n align=\"center\"\n position=\"anchor\"\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\" disabled={loading}>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n onMenuChange={(e) => {\n if (following && e.open) {\n // Fetch lists that have this account\n (async () => {\n try {\n const lists = await currentMasto.v1.accounts\n .$select(accountID.current)\n .lists.list();\n console.log('fetched account lists', lists);\n setLists(lists);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }}\n >\n {currentAuthenticated && !isSelf && (\n <>\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `@${currentInfo?.acct || acct} `,\n },\n });\n }}\n >\n <Icon icon=\"at\" />\n <span>\n <Trans>\n Mention <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setShowTranslatedBio(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate bio</Trans>\n </span>\n </MenuItem>\n {supports('@mastodon/profile-private-note') && (\n <MenuItem\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n {privateNote ? t`Edit private note` : t`Add private note`}\n </span>\n </MenuItem>\n )}\n {following && !!relationship && (\n <>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n notify: !notifying,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.notifying\n ? t`Notifications enabled for @${username}'s posts.`\n : t` Notifications disabled for @${username}'s posts.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"notification\" />\n <span>\n {notifying\n ? t`Disable notifications`\n : t`Enable notifications`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n reblogs: !showingReblogs,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.showingReblogs\n ? t`Boosts from @${username} enabled.`\n : t`Boosts from @${username} disabled.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"rocket\" />\n <span>\n {showingReblogs ? t`Disable boosts` : t`Enable boosts`}\n </span>\n </MenuItem>\n </>\n )}\n {/* Add/remove from lists is only possible if following the account */}\n {following && (\n <MenuItem\n onClick={() => {\n setShowAddRemoveLists(true);\n }}\n >\n <Icon icon=\"list\" />\n {lists.length ? (\n <>\n <small class=\"menu-grow\">\n <Trans>Add/Remove from Lists</Trans>\n <br />\n <span class=\"more-insignificant\">\n {lists.map((list) => list.title).join(', ')}\n </span>\n </small>\n <small class=\"more-insignificant\">{lists.length}</small>\n </>\n ) : (\n <span>\n <Trans>Add/Remove from Lists</Trans>\n </span>\n )}\n </MenuItem>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n const handle = `@${currentInfo?.acct || acctWithInstance}`;\n try {\n navigator.clipboard.writeText(handle);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"copy\" />\n <small>\n <Trans>Copy handle</Trans>\n <br />\n <span class=\"more-insignificant bidi-isolate\">\n @{currentInfo?.acct || acctWithInstance}\n </span>\n </small>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <small class=\"menu-double-lines\">{niceAccountURL(url)}</small>\n </MenuItem>\n <div class=\"menu-horizontal\">\n <MenuItem\n onClick={() => {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy</Trans>\n </span>\n </MenuItem>\n {navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n <MenuItem\n onClick={() => {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />\n <span>\n <Trans>Share…</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n {!!relationship && (\n <>\n <MenuDivider />\n {muting ? (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unmute();\n console.log('unmuting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unmuted @${username}`);\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"unmute\" />\n <span>\n <Trans>\n Unmute <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n ) : (\n <SubMenu2\n menuClassName=\"menu-blur\"\n openTrigger=\"clickOnly\"\n direction=\"bottom\"\n overflow=\"auto\"\n shift={16}\n label={\n <>\n <Icon icon=\"mute\" />\n <span class=\"menu-grow\">\n <Trans>\n Mute <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n <span\n style={{\n textOverflow: 'clip',\n }}\n >\n <Icon icon=\"time\" />\n <Icon icon=\"chevron-right\" />\n </span>\n </>\n }\n >\n <div class=\"menu-wrap\">\n {MUTE_DURATIONS.map((duration) => (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship =\n await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .mute({\n duration,\n });\n console.log('muting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(\n t`Muted @${username} for ${\n typeof MUTE_DURATIONS_LABELS[duration] ===\n 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])\n }`,\n );\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n showToast(t`Unable to mute @${username}`);\n }\n })();\n }}\n >\n {typeof MUTE_DURATIONS_LABELS[duration] === 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])}\n </MenuItem>\n ))}\n </div>\n </SubMenu2>\n )}\n {followedBy && (\n <MenuConfirm\n subMenu\n menuItemClassName=\"danger\"\n confirmLabel={\n <>\n <Icon icon=\"user-x\" />\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{username}</span>{' '}\n from followers?\n </Trans>\n </span>\n </>\n }\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .removeFromFollowers();\n console.log(\n 'removing from followers',\n newRelationship,\n );\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`@${username} removed from followers`);\n states.reloadGenericAccounts.id = 'followers';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"user-x\" />\n <span>\n <Trans>Remove follower…</Trans>\n </span>\n </MenuConfirm>\n )}\n <MenuConfirm\n subMenu\n confirm={!blocking}\n confirmLabel={\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>?\n </Trans>\n </span>\n </>\n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // if (!blocking && !confirm(`Block @${username}?`)) {\n // return;\n // }\n setRelationshipUIState('loading');\n (async () => {\n try {\n if (blocking) {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unblock();\n console.log('unblocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unblocked @${username}`);\n } else {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .block();\n console.log('blocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Blocked @${username}`);\n }\n states.reloadGenericAccounts.id = 'block';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n if (blocking) {\n showToast(t`Unable to unblock @${username}`);\n } else {\n showToast(t`Unable to block @${username}`);\n }\n }\n })();\n }}\n >\n {blocking ? (\n <>\n <Icon icon=\"unblock\" />\n <span>\n <Trans>\n Unblock <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n className=\"danger\"\n onClick={() => {\n states.showReportModal = {\n account: currentInfo || info,\n };\n }}\n >\n <Icon icon=\"flag\" />\n <span>\n <Trans>\n Report <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </MenuItem>\n </>\n )}\n {currentAuthenticated &&\n isSelf &&\n standalone &&\n supports('@mastodon/profile-edit') && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n setShowEditProfile(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n <Trans>Edit profile</Trans>\n </span>\n </MenuItem>\n </>\n )}\n {import.meta.env.DEV && currentAuthenticated && isSelf && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={async () => {\n const relationships =\n await currentMasto.v1.accounts.relationships.fetch({\n id: [accountID.current],\n });\n const { note } = relationships[0] || {};\n if (note) {\n alert(note);\n console.log(note);\n }\n }}\n >\n <Icon icon=\"pencil\" />\n <span>See note</span>\n </MenuItem>\n </>\n )}\n </Menu2>\n {!relationship && relationshipUIState === 'loading' && (\n <Loader abrupt />\n )}\n {!!relationship && !moved && (\n <MenuConfirm\n confirm={following || requested}\n confirmLabel={\n <span>\n {requested\n ? t`Withdraw follow request?`\n : t`Unfollow @${info.acct || info.username}?`}\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={loading}\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n let newRelationship;\n\n if (following || requested) {\n // const yes = confirm(\n // requested\n // ? 'Withdraw follow request?'\n // : `Unfollow @${info.acct || info.username}?`,\n // );\n\n // if (yes) {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .unfollow();\n // }\n } else {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow();\n }\n\n if (newRelationship) setRelationship(newRelationship);\n setRelationshipUIState('default');\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class={`${following || requested ? 'light swap' : ''}`}\n data-swap-state={following || requested ? 'danger' : ''}\n disabled={loading}\n >\n {following ? (\n <>\n <span>\n <Trans>Following</Trans>\n </span>\n <span>\n <Trans>Unfollow…</Trans>\n </span>\n </>\n ) : requested ? (\n <>\n <span>\n <Trans>Requested</Trans>\n </span>\n <span>\n <Trans>Withdraw…</Trans>\n </span>\n </>\n ) : locked ? (\n <>\n <Icon icon=\"lock\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n ) : (\n t`Follow`\n )}\n </button>\n </MenuConfirm>\n )}\n </span>\n </div>\n {!!showTranslatedBio && (\n <Modal\n onClose={() => {\n setShowTranslatedBio(false);\n }}\n >\n <TranslatedBioSheet\n note={note}\n fields={fields}\n onClose={() => setShowTranslatedBio(false)}\n />\n </Modal>\n )}\n {!!showAddRemoveLists && (\n <Modal\n onClose={() => {\n setShowAddRemoveLists(false);\n }}\n >\n <AddRemoveListsSheet\n accountID={accountID.current}\n onClose={() => setShowAddRemoveLists(false)}\n />\n </Modal>\n )}\n {!!showPrivateNoteModal && (\n <Modal\n onClose={() => {\n setShowPrivateNoteModal(false);\n }}\n >\n <PrivateNoteSheet\n account={info}\n note={privateNote}\n onRelationshipChange={(relationship) => {\n setRelationship(relationship);\n // onRelationshipChange({ relationship, currentID: accountID.current });\n }}\n onClose={() => setShowPrivateNoteModal(false)}\n />\n </Modal>\n )}\n {!!showEditProfile && (\n <Modal\n onClose={() => {\n setShowEditProfile(false);\n }}\n >\n <EditProfileSheet\n onClose={({ state, account } = {}) => {\n setShowEditProfile(false);\n if (state === 'success' && account) {\n onProfileUpdate(account);\n }\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n\n// Apply more alpha if high luminence\nfunction lightenRGB([r, g, b]) {\n const luminence = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n console.log('luminence', luminence);\n let alpha;\n if (luminence >= 220) {\n alpha = 1;\n } else if (luminence <= 50) {\n alpha = 0.1;\n } else {\n alpha = luminence / 255;\n }\n alpha = Math.min(1, alpha);\n return [r, g, b, alpha];\n}\n\nfunction niceAccountURL(url) {\n if (!url) return;\n const urlObj = URL.parse(url);\n const { host, pathname } = urlObj;\n const path = pathname.replace(/\\/$/, '').replace(/^\\//, '');\n return (\n <>\n <span class=\"more-insignificant\">{punycode.toUnicode(host)}/</span>\n <wbr />\n <span>{path}</span>\n </>\n );\n}\n\nfunction TranslatedBioSheet({ note, fields, onClose }) {\n const fieldsText =\n fields\n ?.map(({ name, value }) => `${name}\\n${getHTMLText(value)}`)\n .join('\\n\\n') || '';\n\n const text = getHTMLText(note) + (fieldsText ? `\\n\\n${fieldsText}` : '');\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Translated Bio</Trans>\n </h2>\n </header>\n <main>\n <p\n style={{\n whiteSpace: 'pre-wrap',\n }}\n >\n {text}\n </p>\n <TranslationBlock forceTranslate text={text} />\n </main>\n </div>\n );\n}\n\nfunction AddRemoveListsSheet({ accountID, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [listsContainingAccount, setListsContainingAccount] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await getLists();\n setLists(lists);\n const listsContainingAccount = await masto.v1.accounts\n .$select(accountID)\n .lists.list();\n console.log({ lists, listsContainingAccount });\n setListsContainingAccount(listsContainingAccount);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div class=\"sheet\" id=\"list-add-remove-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Add/Remove from Lists</Trans>\n </h2>\n </header>\n <main>\n {lists.length > 0 ? (\n <ul class=\"list-add-remove\">\n {lists.map((list) => {\n const inList = listsContainingAccount.some(\n (l) => l.id === list.id,\n );\n return (\n <li>\n <button\n type=\"button\"\n class={`light ${inList ? 'checked' : ''}`}\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n if (inList) {\n await masto.v1.lists\n .$select(list.id)\n .accounts.remove({\n accountIds: [accountID],\n });\n } else {\n await masto.v1.lists\n .$select(list.id)\n .accounts.create({\n accountIds: [accountID],\n });\n }\n // setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n inList\n ? t`Unable to remove from list.`\n : t`Unable to add to list.`,\n );\n }\n })();\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />\n <span>{list.title}</span>\n </button>\n </li>\n );\n })}\n </ul>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists.</Trans>\n </p>\n )}\n <button\n type=\"button\"\n class=\"plain2\"\n onClick={() => setShowListAddEditModal(true)}\n disabled={uiState !== 'default'}\n >\n <Icon icon=\"plus\" size=\"l\" />{' '}\n <span>\n <Trans>New list</Trans>\n </span>\n </button>\n </main>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nfunction PrivateNoteSheet({\n account,\n note: initialNote,\n onRelationshipChange = () => {},\n onClose = () => {},\n}) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const textareaRef = useRef(null);\n\n useEffect(() => {\n let timer;\n if (textareaRef.current && !initialNote) {\n timer = setTimeout(() => {\n textareaRef.current.focus?.();\n }, 100);\n }\n return () => {\n clearTimeout(timer);\n };\n }, []);\n\n return (\n <div class=\"sheet\" id=\"private-note-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>\n Private note about{' '}\n <span class=\"bidi-isolate\">\n @{account?.username || account?.acct}\n </span>\n </Trans>\n </b>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const note = formData.get('note');\n if (note?.trim() !== initialNote?.trim()) {\n setUIState('loading');\n (async () => {\n try {\n const newRelationship = await masto.v1.accounts\n .$select(account?.id)\n .note.create({\n comment: note,\n });\n console.log('updated relationship', newRelationship);\n setUIState('default');\n onRelationshipChange(newRelationship);\n onClose();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(e?.message || t`Unable to update private note.`);\n }\n })();\n }\n }}\n >\n <textarea\n ref={textareaRef}\n name=\"note\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n >\n {initialNote}\n </textarea>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <span>\n <Loader abrupt hidden={uiState !== 'loading'} />\n <button disabled={uiState === 'loading'} type=\"submit\">\n <Trans>Save &amp; close</Trans>\n </button>\n </span>\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction EditProfileSheet({ onClose = () => {} }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('loading');\n const [account, setAccount] = useState(null);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await masto.v1.accounts.verifyCredentials();\n setAccount(acc);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n console.log('EditProfileSheet', account);\n const { displayName, source } = account || {};\n const { note, fields } = source || {};\n const fieldsAttributesRef = useRef(null);\n\n return (\n <div class=\"sheet\" id=\"edit-profile-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>Edit profile</Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const displayName = formData.get('display_name');\n const note = formData.get('note');\n const fieldsAttributesFields =\n fieldsAttributesRef.current.querySelectorAll(\n 'input[name^=\"fields_attributes\"]',\n );\n const fieldsAttributes = [];\n fieldsAttributesFields.forEach((field) => {\n const name = field.name;\n const [_, index, key] =\n name.match(/fields_attributes\\[(\\d+)\\]\\[(.+)\\]/) || [];\n const value = field.value ? field.value.trim() : '';\n if (index && key && value) {\n if (!fieldsAttributes[index]) fieldsAttributes[index] = {};\n fieldsAttributes[index][key] = value;\n }\n });\n // Fill in the blanks\n fieldsAttributes.forEach((field) => {\n if (field.name && !field.value) {\n field.value = '';\n }\n });\n\n (async () => {\n try {\n const newAccount = await masto.v1.accounts.updateCredentials({\n displayName,\n note,\n fieldsAttributes,\n });\n console.log('updated account', newAccount);\n onClose?.({\n state: 'success',\n account: newAccount,\n });\n } catch (e) {\n console.error(e);\n alert(e?.message || t`Unable to update profile.`);\n }\n })();\n }}\n >\n <p>\n <label>\n <Trans>Name</Trans>{' '}\n <input\n type=\"text\"\n name=\"display_name\"\n defaultValue={displayName}\n maxLength={30}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n <p>\n <label>\n <Trans>Bio</Trans>\n <textarea\n defaultValue={note}\n name=\"note\"\n maxLength={500}\n rows=\"5\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n {/* Table for fields; name and values are in fields, min 4 rows */}\n <p>\n <Trans>Extra fields</Trans>\n </p>\n <table ref={fieldsAttributesRef}>\n <thead>\n <tr>\n <th>\n <Trans>Label</Trans>\n </th>\n <th>\n <Trans>Content</Trans>\n </th>\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: Math.max(4, fields.length) }).map(\n (_, i) => {\n const { name = '', value = '' } = fields[i] || {};\n return (\n <FieldsAttributesRow\n key={i}\n name={name}\n value={value}\n index={i}\n disabled={uiState === 'loading'}\n />\n );\n },\n )}\n </tbody>\n </table>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Save</Trans>\n </button>\n </footer>\n </form>\n )}\n </main>\n </div>\n );\n}\n\nfunction FieldsAttributesRow({ name, value, disabled, index: i }) {\n const [hasValue, setHasValue] = useState(!!value);\n return (\n <tr>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][name]`}\n defaultValue={name}\n disabled={disabled}\n maxLength={255}\n required={hasValue}\n dir=\"auto\"\n />\n </td>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][value]`}\n defaultValue={value}\n disabled={disabled}\n maxLength={255}\n onChange={(e) => setHasValue(!!e.currentTarget.value)}\n dir=\"auto\"\n />\n </td>\n </tr>\n );\n}\n\nfunction AccountHandleInfo({ acct, instance }) {\n // acct = username or username@server\n let [username, server] = acct.split('@');\n if (!server) server = instance;\n return (\n <div class=\"handle-info\">\n <span class=\"handle-handle\">\n <b class=\"handle-username\">{username}</b>\n <span class=\"handle-at\">@</span>\n <b class=\"handle-server\">{server}</b>\n </span>\n <div class=\"handle-legend\">\n <span class=\"ib\">\n <span class=\"handle-legend-icon username\" /> <Trans>username</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"handle-legend-icon server\" />{' '}\n <Trans>server domain name</Trans>\n </span>\n </div>\n </div>\n );\n}\n\nexport default AccountInfo;\n","import { t } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountInfo from './account-info';\nimport Icon from './icon';\n\nfunction AccountSheet({ account, instance: propInstance, onClose }) {\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const isString = typeof account === 'string';\n\n useEffect(() => {\n if (!isString) {\n states.accounts[`${account.id}@${instance}`] = account;\n }\n }, [account]);\n\n useLocationChange(onClose);\n\n return (\n <div\n class=\"sheet\"\n // onClick={(e) => {\n // const accountBlock = e.target.closest('.account-block');\n // if (accountBlock) {\n // onClose({\n // destination: 'account-statuses',\n // });\n // }\n // }}\n >\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <AccountInfo\n instance={instance}\n authenticated={authenticated}\n account={account}\n fetchAccount={async () => {\n if (isString) {\n try {\n const info = await masto.v1.accounts.lookup({\n acct: account,\n skip_webfinger: false,\n });\n return info;\n } catch (e) {\n const result = await masto.v2.search.fetch({\n q: account,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n } else if (/https?:\\/\\/[^/]+\\/@/.test(account)) {\n const accountURL = URL.parse(account);\n const { hostname, pathname } = accountURL;\n const acct =\n pathname.replace(/^\\//, '').replace(/\\/$/, '') +\n '@' +\n hostname;\n const result = await masto.v2.search.fetch({\n q: acct,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n }\n }\n }\n } else {\n return account;\n }\n }}\n />\n </div>\n );\n}\n\nexport default AccountSheet;\n","import './drafts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useMemo, useReducer, useState } from 'react';\n\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport niceDateTime from '../utils/nice-date-time';\nimport states from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Icon from './icon';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\n\nfunction Drafts({ onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [drafts, setDrafts] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n const drafts = await db.drafts.getMany(ownKeys);\n drafts.sort(\n (a, b) =>\n new Date(b.updatedAt).getTime() -\n new Date(a.updatedAt).getTime(),\n );\n setDrafts(drafts);\n } else {\n setDrafts([]);\n }\n } else {\n setDrafts([]);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const hasDrafts = drafts?.length > 0;\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Unsent drafts</Trans>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </h2>\n {hasDrafts && (\n <div class=\"insignificant\">\n <Trans>\n Looks like you have unsent drafts. Let's continue where you left\n off.\n </Trans>\n </div>\n )}\n </header>\n <main>\n {hasDrafts ? (\n <>\n <ul class=\"drafts-list\">\n {drafts.map((draft) => {\n const { updatedAt, key, draftStatus, replyTo } = draft;\n const updatedAtDate = new Date(updatedAt);\n return (\n <li key={updatedAt}>\n <div class=\"mini-draft-meta\">\n <b>\n <Icon icon={replyTo ? 'reply' : 'quill'} size=\"s\" />{' '}\n <time>\n {!!replyTo && (\n <>\n <span class=\"bidi-isolate\">\n @{replyTo.account.acct}\n </span>\n <br />\n </>\n )}\n {niceDateTime(updatedAtDate)}\n </time>\n </b>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete this draft?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n try {\n // const yes = confirm('Delete this draft?');\n // if (yes) {\n await db.drafts.del(key);\n reload();\n // }\n } catch (e) {\n alert(t`Error deleting draft! Please try again.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"small light\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n </div>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n class=\"draft-item\"\n onClick={async () => {\n // console.log({ draftStatus });\n let replyToStatus;\n if (replyTo) {\n setUIState('loading');\n try {\n replyToStatus = await masto.v1.statuses\n .$select(replyTo.id)\n .fetch();\n } catch (e) {\n console.error(e);\n alert(t`Error fetching reply-to status!`);\n setUIState('default');\n return;\n }\n setUIState('default');\n }\n window.__COMPOSE__ = {\n draftStatus,\n replyToStatus,\n };\n states.showCompose = true;\n states.showDrafts = false;\n }}\n >\n <MiniDraft draft={draft} />\n </button>\n </li>\n );\n })}\n </ul>\n {drafts.length > 1 && (\n <p>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete all drafts?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n // const yes = confirm('Delete all drafts?');\n // if (yes) {\n setUIState('loading');\n try {\n await db.drafts.delMany(\n drafts.map((draft) => draft.key),\n );\n setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n alert(t`Error deleting drafts! Please try again.`);\n setUIState('error');\n }\n // }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete all…</Trans>\n </button>\n </MenuConfirm>\n </p>\n )}\n </>\n ) : (\n <p>\n <Trans>No drafts found.</Trans>\n </p>\n )}\n </main>\n </div>\n );\n}\n\nfunction MiniDraft({ draft }) {\n const { draftStatus, replyTo } = draft;\n const { status, spoilerText, poll, mediaAttachments } = draftStatus;\n const hasPoll = poll?.options?.length > 0;\n const hasMedia = mediaAttachments?.length > 0;\n const hasPollOrMedia = hasPoll || hasMedia;\n const firstImageMedia = useMemo(() => {\n if (!hasMedia) return;\n const image = mediaAttachments.find((media) => /image/.test(media.type));\n if (!image) return;\n const { file } = image;\n const objectURL = URL.createObjectURL(file);\n return objectURL;\n }, [hasMedia, mediaAttachments]);\n return (\n <>\n <div class=\"mini-draft\">\n {hasPollOrMedia && (\n <div\n class={`mini-draft-aside ${firstImageMedia ? 'has-image' : ''}`}\n style={\n firstImageMedia\n ? {\n '--bg-image': `url(${firstImageMedia})`,\n }\n : {}\n }\n >\n {hasPoll && <Icon icon=\"poll\" alt={t`Poll`} />}\n {hasMedia && (\n <span>\n <Icon icon=\"attachment\" alt={t`Media`} />{' '}\n <small>{mediaAttachments?.length}</small>\n </span>\n )}\n </div>\n )}\n <div class=\"mini-draft-main\">\n {!!spoilerText && <div class=\"mini-draft-spoiler\">{spoilerText}</div>}\n {!!status && <div class=\"mini-draft-status\">{status}</div>}\n </div>\n </div>\n </>\n );\n}\n\nexport default Drafts;\n","import './embed-modal.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport Icon from './icon';\n\nfunction EmbedModal({ html, url, width, height, onClose = () => {} }) {\n return (\n <div class=\"embed-modal-container\">\n <div class=\"top-controls\">\n <button type=\"button\" class=\"light\" onClick={() => onClose()}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n {url && (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"button plain\"\n >\n <span>\n <Trans>Open in new window</Trans>\n </span>{' '}\n <Icon icon=\"external\" />\n </a>\n )}\n </div>\n <div\n class=\"embed-content\"\n dangerouslySetInnerHTML={{ __html: html }}\n style={{\n '--width': width + 'px',\n '--height': height + 'px',\n '--aspect-ratio': `${width}/${height}`,\n }}\n />\n </div>\n );\n}\n\nexport default EmbedModal;\n","import './generic-accounts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Link from './link';\nimport Loader from './loader';\nimport Status from './status';\n\nexport default function GenericAccounts({\n instance,\n excludeRelationshipAttrs = [],\n postID,\n onClose = () => {},\n blankCopy = t`Nothing to show`,\n}) {\n const { masto, instance: currentInstance } = api();\n const isCurrentInstance = instance ? instance === currentInstance : true;\n const snapStates = useSnapshot(states);\n ``;\n const [uiState, setUIState] = useState('default');\n const [accounts, setAccounts] = useState([]);\n const [showMore, setShowMore] = useState(false);\n\n useLocationChange(onClose);\n\n if (!snapStates.showGenericAccounts) {\n return null;\n }\n\n const {\n id,\n heading,\n fetchAccounts,\n accounts: staticAccounts,\n showReactions,\n } = snapStates.showGenericAccounts;\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\n\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n if (!isCurrentInstance) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n const loadAccounts = (firstLoad) => {\n if (!fetchAccounts) return;\n if (firstLoad) setAccounts([]);\n setUIState('loading');\n (async () => {\n try {\n const { done, value } = await fetchAccounts(firstLoad);\n if (Array.isArray(value)) {\n if (firstLoad) {\n const accounts = [];\n for (let i = 0; i < value.length; i++) {\n const account = value[i];\n const theAccount = accounts.find(\n (a, j) => a.id === account.id && i !== j,\n );\n if (!theAccount) {\n accounts.push({\n _types: [],\n ...account,\n });\n } else {\n theAccount._types.push(...account._types);\n }\n }\n setAccounts(accounts);\n } else {\n // setAccounts((prev) => [...prev, ...value]);\n // Merge accounts by id and _types\n setAccounts((prev) => {\n const newAccounts = prev;\n for (const account of value) {\n const theAccount = newAccounts.find((a) => a.id === account.id);\n if (!theAccount) {\n newAccounts.push(account);\n } else {\n theAccount._types.push(...account._types);\n }\n }\n return newAccounts;\n });\n }\n setShowMore(!done);\n\n loadRelationships(value);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const firstLoad = useRef(true);\n useEffect(() => {\n if (staticAccounts?.length > 0) {\n setAccounts(staticAccounts);\n loadRelationships(staticAccounts);\n } else {\n loadAccounts(true);\n firstLoad.current = false;\n }\n }, [staticAccounts, fetchAccounts]);\n\n useEffect(() => {\n if (firstLoad.current) return;\n // reloadGenericAccounts contains value like {id: 'mute', counter: 1}\n // We only need to reload if the id matches\n if (snapStates.reloadGenericAccounts?.id === id) {\n loadAccounts(true);\n }\n }, [snapStates.reloadGenericAccounts.counter]);\n\n const post = states.statuses[postID];\n\n return (\n <div id=\"generic-accounts-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>{heading || t`Accounts`}</h2>\n </header>\n <main>\n {post && (\n <Link\n to={`/${instance || currentInstance}/s/${post.id}`}\n class=\"post-preview\"\n >\n <Status status={post} size=\"s\" readOnly />\n </Link>\n )}\n {accounts.length > 0 ? (\n <>\n <ul class=\"accounts-list\">\n {accounts.map((account) => {\n const relationship = relationshipsMap[account.id];\n const key = `${account.id}-${account._types?.length || ''}`;\n return (\n <li key={key}>\n {showReactions && account._types?.length > 0 && (\n <div class=\"reactions-block\">\n {account._types.map((type) => (\n <Icon\n icon={\n {\n reblog: 'rocket',\n favourite: 'heart',\n }[type]\n }\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n <div class=\"account-relationships\">\n <AccountBlock\n account={account}\n showStats\n relationship={relationship}\n excludeRelationshipAttrs={excludeRelationshipAttrs}\n />\n </div>\n </li>\n );\n })}\n </ul>\n {uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadAccounts();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadAccounts()}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Error loading accounts</Trans>\n </p>\n ) : (\n <p class=\"ui-state insignificant\">{blankCopy}</p>\n )}\n </main>\n </div>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuItem } from '@szhsin/react-menu';\nimport { useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeMatch from '../utils/locale-match';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Menu2 from './menu2';\nimport TranslationBlock from './translation-block';\n\nexport default function MediaAltModal({ alt, lang, onClose }) {\n const snapStates = useSnapshot(states);\n const [forceTranslate, setForceTranslate] = useState(false);\n const targetLanguage = getTranslateTargetLanguage(true);\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const differentLanguage =\n !!lang &&\n lang !== targetLanguage &&\n !localeMatch([lang], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => lang === l || localeMatch([lang], [l]),\n );\n\n return (\n <div class=\"sheet\" tabindex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Media description</Trans>\n </h2>\n <div class=\"header-side\">\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={forceTranslate}\n onClick={() => {\n setForceTranslate(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuItem>\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n speak(alt, lang);\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </Menu2>\n </div>\n </header>\n <main lang={lang} dir=\"auto\">\n <p\n style={{\n whiteSpace: 'pre-wrap',\n textWrap: 'pretty',\n }}\n >\n {alt}\n </p>\n {(differentLanguage || forceTranslate) && (\n <TranslationBlock\n forceTranslate={forceTranslate}\n sourceLanguage={lang}\n text={alt}\n />\n )}\n </main>\n </div>\n );\n}\n","const { min, max } = Math;\n\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};\n","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of [\n 'Boolean',\n 'Number',\n 'String',\n 'Function',\n 'Array',\n 'Date',\n 'RegExp',\n 'Undefined',\n 'Null'\n]) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}\n","import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0].slice(0);\n};\n","const { PI, min, max } = Math;\n\nconst rnd2 = (a) => Math.round(a * 100) / 100;\nconst rnd3 = (a) => Math.round(a * 100) / 100;\n\nexport { default as clip_rgb } from './clip_rgb.js';\nexport { default as limit } from './limit.js';\nexport { default as type } from './type.js';\nexport { default as unpack } from './unpack.js';\nexport { default as last } from './last.js';\n\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\n/**\n * Reverse the first three elements of an array\n *\n * @param {any[]} arr\n * @returns {any[]}\n */\nfunction reverse3(arr) {\n return [...arr.slice(0, 3).reverse(), ...arr.slice(3)];\n}\n\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max, rnd2, rnd3, reverse3 };\n","// from https://www.w3.org/TR/css-color-4/multiply-matrices.js\nexport default function multiplyMatrices(A, B) {\n let m = A.length;\n\n if (!Array.isArray(A[0])) {\n // A is vector, convert to [[a, b, c, ...]]\n A = [A];\n }\n\n if (!Array.isArray(B[0])) {\n // B is vector, convert to [[a], [b], [c], ...]]\n B = B.map((x) => [x]);\n }\n\n let p = B[0].length;\n let B_cols = B[0].map((_, i) => B.map((x) => x[i])); // transpose B\n let product = A.map((row) =>\n B_cols.map((col) => {\n if (!Array.isArray(row)) {\n return col.reduce((a, c) => a + c * row, 0);\n }\n\n return row.reduce((a, c, i) => a + c * (col[i] || 0), 0);\n })\n );\n\n if (m === 1) {\n product = product[0]; // Avoid [[a, b, c, ...]]\n }\n\n if (p === 1) {\n return product.map((x) => x[0]); // Avoid [[a], [b], [c], ...]]\n }\n\n return product;\n}\n","const labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n labWhitePoint: 'd65',\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1,\n\n kE: 216.0 / 24389.0,\n kKE: 8.0,\n kK: 24389.0 / 27.0,\n\n RefWhiteRGB: {\n // sRGB\n X: 0.95047,\n Y: 1,\n Z: 1.08883\n },\n\n MtxRGB2XYZ: {\n m00: 0.4124564390896922,\n m01: 0.21267285140562253,\n m02: 0.0193338955823293,\n m10: 0.357576077643909,\n m11: 0.715152155287818,\n m12: 0.11919202588130297,\n m20: 0.18043748326639894,\n m21: 0.07217499330655958,\n m22: 0.9503040785363679\n },\n\n MtxXYZ2RGB: {\n m00: 3.2404541621141045,\n m01: -0.9692660305051868,\n m02: 0.055643430959114726,\n m10: -1.5371385127977166,\n m11: 1.8760108454466942,\n m12: -0.2040259135167538,\n m20: -0.498531409556016,\n m21: 0.041556017530349834,\n m22: 1.0572251882231791\n },\n\n // used in rgb2xyz\n As: 0.9414285350000001,\n Bs: 1.040417467,\n Cs: 1.089532651,\n\n MtxAdaptMa: {\n m00: 0.8951,\n m01: -0.7502,\n m02: 0.0389,\n m10: 0.2664,\n m11: 1.7135,\n m12: -0.0685,\n m20: -0.1614,\n m21: 0.0367,\n m22: 1.0296\n },\n\n MtxAdaptMaI: {\n m00: 0.9869929054667123,\n m01: 0.43230526972339456,\n m02: -0.008528664575177328,\n m10: -0.14705425642099013,\n m11: 0.5183602715367776,\n m12: 0.04004282165408487,\n m20: 0.15996265166373125,\n m21: 0.0492912282128556,\n m22: 0.9684866957875502\n }\n};\n\nexport default labConstants;\n\n// taken from https://de.mathworks.com/help/images/ref/whitepoint.html\nconst ILLUMINANTS = new Map([\n // ASTM E308-01\n ['a', [1.0985, 0.35585]],\n // Wyszecki & Stiles, p. 769\n ['b', [1.0985, 0.35585]],\n // C ASTM E308-01\n ['c', [0.98074, 1.18232]],\n // D50 (ASTM E308-01)\n ['d50', [0.96422, 0.82521]],\n // D55 (ASTM E308-01)\n ['d55', [0.95682, 0.92149]],\n // D65 (ASTM E308-01)\n ['d65', [0.95047, 1.08883]],\n // E (ASTM E308-01)\n ['e', [1, 1, 1]],\n // F2 (ASTM E308-01)\n ['f2', [0.99186, 0.67393]],\n // F7 (ASTM E308-01)\n ['f7', [0.95041, 1.08747]],\n // F11 (ASTM E308-01)\n ['f11', [1.00962, 0.6435]],\n ['icc', [0.96422, 0.82521]]\n]);\n\nexport function setLabWhitePoint(name) {\n const ill = ILLUMINANTS.get(String(name).toLowerCase());\n if (!ill) {\n throw new Error('unknown Lab illuminant ' + name);\n }\n labConstants.labWhitePoint = name;\n labConstants.Xn = ill[0];\n labConstants.Zn = ill[1];\n}\n\nexport function getLabWhitePoint() {\n return labConstants.labWhitePoint;\n}\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst lab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b] = args;\n const [x, y, z] = lab2xyz(L, a, b);\n const [r, g, b_] = xyz2rgb(x, y, z);\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\n\nconst lab2xyz = (L, a, b) => {\n const { kE, kK, kKE, Xn, Yn, Zn } = LAB_CONSTANTS;\n\n const fy = (L + 16.0) / 116.0;\n const fx = 0.002 * a + fy;\n const fz = fy - 0.005 * b;\n\n const fx3 = fx * fx * fx;\n const fz3 = fz * fz * fz;\n\n const xr = fx3 > kE ? fx3 : (116.0 * fx - 16.0) / kK;\n const yr = L > kKE ? Math.pow((L + 16.0) / 116.0, 3.0) : L / kK;\n const zr = fz3 > kE ? fz3 : (116.0 * fz - 16.0) / kK;\n\n const x = xr * Xn;\n const y = yr * Yn;\n const z = zr * Zn;\n\n return [x, y, z];\n};\n\nconst compand = (linear) => {\n /* sRGB */\n const sign = Math.sign(linear);\n linear = Math.abs(linear);\n return (\n (linear <= 0.0031308\n ? linear * 12.92\n : 1.055 * Math.pow(linear, 1.0 / 2.4) - 0.055) * sign\n );\n};\n\nconst xyz2rgb = (x, y, z) => {\n const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } =\n LAB_CONSTANTS;\n\n const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cs = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n const Ad =\n RefWhiteRGB.X * MtxAdaptMa.m00 +\n RefWhiteRGB.Y * MtxAdaptMa.m10 +\n RefWhiteRGB.Z * MtxAdaptMa.m20;\n const Bd =\n RefWhiteRGB.X * MtxAdaptMa.m01 +\n RefWhiteRGB.Y * MtxAdaptMa.m11 +\n RefWhiteRGB.Z * MtxAdaptMa.m21;\n const Cd =\n RefWhiteRGB.X * MtxAdaptMa.m02 +\n RefWhiteRGB.Y * MtxAdaptMa.m12 +\n RefWhiteRGB.Z * MtxAdaptMa.m22;\n\n const X1 =\n (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20) *\n (Ad / As);\n const Y1 =\n (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21) *\n (Bd / Bs);\n const Z1 =\n (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22) *\n (Cd / Cs);\n\n const X2 =\n X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;\n const Y2 =\n X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;\n const Z2 =\n X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;\n\n const r = compand(\n X2 * MtxXYZ2RGB.m00 + Y2 * MtxXYZ2RGB.m10 + Z2 * MtxXYZ2RGB.m20\n );\n const g = compand(\n X2 * MtxXYZ2RGB.m01 + Y2 * MtxXYZ2RGB.m11 + Z2 * MtxXYZ2RGB.m21\n );\n const b = compand(\n X2 * MtxXYZ2RGB.m02 + Y2 * MtxXYZ2RGB.m12 + Z2 * MtxXYZ2RGB.m22\n );\n\n return [r * 255, g * 255, b * 255];\n};\n\nexport default lab2rgb;\nexport { xyz2rgb };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { xyz2rgb } from '../lab/lab2rgb.js';\n\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b, ...rest] = args;\n const [X, Y, Z] = OKLab_to_XYZ([L, a, b]);\n const [r, g, b_] = xyz2rgb(X, Y, Z);\n return [r, g, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction OKLab_to_XYZ(OKLab) {\n // Given OKLab, convert to XYZ relative to D65\n var LMStoXYZ = [\n [1.2268798758459243, -0.5578149944602171, 0.2813910456659647],\n [-0.0405757452148008, 1.112286803280317, -0.0717110580655164],\n [-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]\n ];\n var OKLabtoLMS = [\n [1.0, 0.3963377773761749, 0.2158037573099136],\n [1.0, -0.1055613458156586, -0.0638541728258133],\n [1.0, -0.0894841775298119, -1.2914855480194092]\n ];\n\n var LMSnl = multiplyMatrices(OKLabtoLMS, OKLab);\n return multiplyMatrices(\n LMStoXYZ,\n LMSnl.map((c) => c ** 3)\n );\n}\n\nexport default oklab2rgb;\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\nconst rgb2lab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const [L, a, b_] = xyz2lab(x, y, z);\n return [L, a, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nfunction xyz2lab(x, y, z) {\n const { Xn, Yn, Zn, kE, kK } = LAB_CONSTANTS;\n const xr = x / Xn;\n const yr = y / Yn;\n const zr = z / Zn;\n\n const fx = xr > kE ? Math.pow(xr, 1.0 / 3.0) : (kK * xr + 16.0) / 116.0;\n const fy = yr > kE ? Math.pow(yr, 1.0 / 3.0) : (kK * yr + 16.0) / 116.0;\n const fz = zr > kE ? Math.pow(zr, 1.0 / 3.0) : (kK * zr + 16.0) / 116.0;\n\n return [116.0 * fy - 16.0, 500.0 * (fx - fy), 200.0 * (fy - fz)];\n}\n\nfunction gammaAdjustSRGB(companded) {\n const sign = Math.sign(companded);\n companded = Math.abs(companded);\n const linear =\n companded <= 0.04045\n ? companded / 12.92\n : Math.pow((companded + 0.055) / 1.055, 2.4);\n return linear * sign;\n}\n\nconst rgb2xyz = (r, g, b) => {\n // normalize and gamma adjust\n r = gammaAdjustSRGB(r / 255);\n g = gammaAdjustSRGB(g / 255);\n b = gammaAdjustSRGB(b / 255);\n\n const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } =\n LAB_CONSTANTS;\n\n let x = r * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;\n let y = r * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;\n let z = r * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;\n\n const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20;\n let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21;\n let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22;\n\n X *= Ad / As;\n Y *= Bd / Bs;\n Z *= Cd / Cs;\n\n x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;\n y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;\n z = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;\n\n return [x, y, z];\n};\n\nexport default rgb2lab;\nexport { rgb2xyz };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { rgb2xyz } from '../lab/rgb2lab.js';\n\nconst rgb2oklab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const xyz = rgb2xyz(r, g, b);\n const oklab = XYZ_to_OKLab(xyz);\n return [...oklab, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction XYZ_to_OKLab(XYZ) {\n // Given XYZ relative to D65, convert to OKLab\n const XYZtoLMS = [\n [0.819022437996703, 0.3619062600528904, -0.1288737815209879],\n [0.0329836539323885, 0.9292868615863434, 0.0361446663506424],\n [0.0481771893596242, 0.2642395317527308, 0.6335478284694309]\n ];\n const LMStoOKLab = [\n [0.210454268309314, 0.7936177747023054, -0.0040720430116193],\n [1.9779985324311684, -2.4285922420485799, 0.450593709617411],\n [0.0259040424655478, 0.7827717124575296, -0.8086757549230774]\n ];\n\n const LMS = multiplyMatrices(XYZtoLMS, XYZ);\n // JavaScript Math.cbrt returns a sign-matched cube root\n // beware if porting to other languages\n // especially if tempted to use a general power function\n return multiplyMatrices(\n LMStoOKLab,\n LMS.map((c) => Math.cbrt(c))\n );\n // L in range [0,1]. For use in CSS, multiply by 100 and add a percent\n}\n\nexport default rgb2oklab;\n","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst { sin, cos } = Math;\n\nconst lch2lab = (...args) => {\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n let [l, c, h] = unpack(args, 'lch');\n if (isNaN(h)) h = 0;\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n};\n\nexport default lch2lab;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\n\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h, ...rest] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default oklch2rgb;\n","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst { sqrt, atan2, round } = Math;\n\nconst lab2lch = (...args) => {\n const [l, a, b] = unpack(args, 'lab');\n const c = sqrt(a * a + b * b);\n let h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) h = Number.NaN;\n return [l, c, h];\n};\n\nexport default lab2lch;\n","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\n\nconst rgb2oklch = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n const [L, c, h] = lab2lch(l, a, b_);\n return [L, c, h, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default rgb2oklch;\n","import { t, Trans } from '@lingui/macro';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { oklch2rgb, rgb2oklch } from '../utils/color-utils';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Media from './media';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\n\nconst { PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL } = import.meta.env;\n\nfunction MediaModal({\n mediaAttachments,\n statusID,\n instance,\n lang,\n index = 0,\n onClose = () => {},\n}) {\n const [uiState, setUIState] = useState('default');\n const carouselRef = useRef(null);\n\n const [currentIndex, setCurrentIndex] = useState(index);\n const carouselFocusItem = useRef(null);\n useLayoutEffect(() => {\n carouselFocusItem.current?.scrollIntoView();\n\n // history.pushState({ mediaModal: true }, '');\n // const handlePopState = (e) => {\n // if (e.state?.mediaModal) {\n // onClose();\n // }\n // };\n // window.addEventListener('popstate', handlePopState);\n // return () => {\n // window.removeEventListener('popstate', handlePopState);\n // };\n }, []);\n const prevStatusID = useRef(statusID);\n useEffect(() => {\n const scrollLeft = index * carouselRef.current.clientWidth;\n const differentStatusID = prevStatusID.current !== statusID;\n if (differentStatusID) prevStatusID.current = statusID;\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left: scrollLeft * (isRTL() ? -1 : 1),\n behavior: differentStatusID ? 'auto' : 'smooth',\n });\n }, [index, statusID]);\n\n const [showControls, setShowControls] = useState(true);\n\n useEffect(() => {\n let handleSwipe = () => {\n onClose();\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('swiped-down', handleSwipe);\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('swiped-down', handleSwipe);\n }\n };\n }, []);\n\n useHotkeys(\n 'esc',\n onClose,\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n [onClose],\n );\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n let timer = setTimeout(() => {\n carouselRef.current?.focus?.();\n }, 100);\n return () => clearTimeout(timer);\n }, []);\n\n const mediaOkColors = useMemo(() => {\n return mediaAttachments?.map((media) => {\n const { blurhash } = media;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n return rgb2oklch(averageColor);\n }\n return null;\n });\n }, [mediaAttachments]);\n const mediaAccentColors = useMemo(() => {\n return mediaOkColors?.map((okColor) => {\n if (okColor) {\n return {\n light: oklch2rgb([0.95, 0.01, okColor[2]]),\n dark: oklch2rgb([0.35, 0.01, okColor[2]]),\n default: oklch2rgb([0.6, okColor[1], okColor[2]]),\n };\n }\n return null;\n });\n });\n const mediaAccentGradients = useMemo(() => {\n const gap = 5;\n const range = 100 / mediaAccentColors.length;\n const colors = mediaAccentColors.map((color, i) => {\n const start = i * range + gap;\n const end = (i + 1) * range - gap;\n if (color?.light && color?.dark) {\n return {\n light: `\n rgb(${color.light?.join(',')}) ${start}%, \n rgb(${color.light?.join(',')}) ${end}%\n `,\n dark: `\n rgb(${color.dark?.join(',')}) ${start}%, \n rgb(${color.dark?.join(',')}) ${end}%\n `,\n };\n }\n\n return {\n light: `\n transparent ${start}%, \n transparent ${end}%\n `,\n dark: `\n transparent ${start}%, \n transparent ${end}%\n `,\n };\n });\n const lightGradient = colors.map((color) => color.light).join(', ');\n const darkGradient = colors.map((color) => color.dark).join(', ');\n return {\n light: lightGradient,\n dark: darkGradient,\n };\n }, [mediaAccentColors]);\n\n let toastRef = useRef(null);\n useEffect(() => {\n return () => {\n toastRef.current?.hideToast?.();\n };\n }, []);\n\n useLayoutEffect(() => {\n const currentColor = mediaAccentColors[currentIndex];\n let $meta;\n let metaColor;\n if (currentColor) {\n const theme = store.local.get('theme');\n if (theme) {\n const mediaColor = `rgb(${currentColor[theme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n } else {\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n const mediaColor = `rgb(${currentColor[colorScheme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n }\n }\n return () => {\n // Reset meta color\n if ($meta && metaColor) {\n $meta.content = metaColor;\n }\n };\n }, [currentIndex, mediaAccentColors]);\n\n return (\n <div\n class={`media-modal-container media-modal-count-${mediaAttachments?.length}`}\n >\n <div\n ref={carouselRef}\n tabIndex=\"0\"\n data-swipe-threshold=\"44\"\n class=\"carousel\"\n onClick={(e) => {\n if (\n e.target.classList.contains('carousel-item') ||\n e.target.classList.contains('media') ||\n e.target.classList.contains('media-zoom')\n ) {\n onClose();\n }\n }}\n style={\n mediaAttachments.length > 1\n ? {\n backgroundAttachment: 'local',\n '--accent-gradient-light': mediaAccentGradients?.light,\n '--accent-gradient-dark': mediaAccentGradients?.dark,\n // backgroundImage: `linear-gradient(\n // to ${isRTL() ? 'left' : 'right'}, ${mediaAccentGradient})`,\n }\n : {}\n }\n >\n {mediaAttachments?.map((media, i) => {\n const accentColor =\n mediaAttachments.length === 1 ? mediaAccentColors[i] : null;\n return (\n <div\n class=\"carousel-item\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.default.join(',')})`,\n '--accent-light-color': `rgb(${accentColor.light?.join(\n ',',\n )})`,\n '--accent-dark-color': `rgb(${accentColor.dark?.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.default.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n tabindex=\"0\"\n key={media.id}\n ref={i === currentIndex ? carouselFocusItem : null}\n onClick={(e) => {\n // console.log(e);\n // if (e.target !== e.currentTarget) {\n // setShowControls(!showControls);\n // }\n if (!e.target.classList.contains('media')) {\n setShowControls(!showControls);\n }\n }}\n >\n {!!media.description && (\n <button\n type=\"button\"\n class=\"media-alt\"\n hidden={!showControls}\n onClick={() => {\n states.showMediaAlt = {\n alt: media.description,\n lang,\n };\n }}\n >\n <span class=\"alt-badge\">ALT</span>\n <span class=\"media-alt-desc\" lang={lang} dir=\"auto\">\n {media.description}\n </span>\n </button>\n )}\n <Media media={media} showOriginal lang={lang} />\n </div>\n );\n })}\n </div>\n <div class=\"carousel-top-controls\" hidden={!showControls}>\n <span>\n <button\n type=\"button\"\n class=\"carousel-button\"\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n </span>\n {mediaAttachments?.length > 1 ? (\n <span class=\"carousel-dots\">\n {mediaAttachments?.map((media, i) => (\n <button\n key={media.id}\n type=\"button\"\n disabled={i === currentIndex}\n class={`carousel-dot ${i === currentIndex ? 'active' : ''}`}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n const left =\n carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1);\n carouselRef.current.focus();\n carouselRef.current.scrollTo({ left, behavior: 'smooth' });\n }}\n >\n <Icon icon=\"round\" size=\"s\" alt=\"⸱\" />\n </button>\n ))}\n </span>\n ) : (\n <span />\n )}\n <span>\n <Menu2\n overflow=\"auto\"\n align=\"end\"\n position=\"anchor\"\n gap={4}\n menuClassName=\"glass-menu\"\n menuButton={\n <button type=\"button\" class=\"carousel-button\">\n <Icon icon=\"more\" alt={t`More`} />\n </button>\n }\n >\n <MenuLink\n href={\n mediaAttachments[currentIndex]?.remoteUrl ||\n mediaAttachments[currentIndex]?.url\n }\n class=\"carousel-button\"\n target=\"_blank\"\n title={t`Open original media in new window`}\n >\n <Icon icon=\"popout\" />\n <span>\n <Trans>Open original media</Trans>\n </span>\n </MenuLink>\n {import.meta.env.DEV && // Only dev for now\n !!states.settings.mediaAltGenerator &&\n !!IMG_ALT_API_URL &&\n !!mediaAttachments[currentIndex]?.url &&\n !mediaAttachments[currentIndex]?.description &&\n mediaAttachments[currentIndex]?.type === 'image' && (\n <>\n <MenuDivider />\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n toastRef.current = showToast({\n text: t`Attempting to describe image. Please wait…`,\n duration: -1,\n });\n (async function () {\n try {\n const response = await fetch(\n `${IMG_ALT_API_URL}?image=${encodeURIComponent(\n mediaAttachments[currentIndex]?.url,\n )}`,\n ).then((r) => r.json());\n states.showMediaAlt = {\n alt: response.description,\n };\n } catch (e) {\n console.error(e);\n showToast(t`Failed to describe image`);\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n <Icon icon=\"sparkles2\" />\n <span>\n <Trans>Describe image…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </Menu2>{' '}\n <Link\n to={`${instance ? `/${instance}` : ''}/s/${statusID}${\n window.matchMedia('(min-width: calc(40em + 350px))').matches\n ? `?media=${currentIndex + 1}`\n : ''\n }`}\n class=\"button carousel-button media-post-link\"\n // onClick={() => {\n // // if small screen (not media query min-width 40em + 350px), run onClose\n // if (\n // !window.matchMedia('(min-width: calc(40em + 350px))').matches\n // ) {\n // onClose();\n // }\n // }}\n >\n <span class=\"button-label\">\n <Trans>View post</Trans>{' '}\n </span>\n &raquo;\n </Link>\n </span>\n </div>\n {mediaAttachments?.length > 1 && (\n <div class=\"carousel-controls\" hidden={!showControls}>\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === 0}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex - 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-left\" alt={t`Previous`} />\n </button>\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === mediaAttachments.length - 1}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex + 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-right\" alt={t`Next`} />\n </button>\n </div>\n )}\n </div>\n );\n}\n\nexport default MediaModal;\n","import './report-modal.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { useMemo, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport { getCurrentInstance } from '../utils/store-utils';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Loader from './loader';\nimport Status from './status';\n\n// NOTE: `dislike` hidden for now, it's actually not used for reporting\n// Mastodon shows another screen for unfollowing, muting or blocking instead of reporting\n\nconst CATEGORIES = [, /*'dislike'*/ 'spam', 'legal', 'violation', 'other'];\n// `violation` will be set if there are `rule_ids[]`\n\nconst CATEGORIES_INFO = {\n // dislike: {\n // label: 'Dislike',\n // description: 'Not something you want to see',\n // },\n spam: {\n label: msg`Spam`,\n description: msg`Malicious links, fake engagement, or repetitive replies`,\n },\n legal: {\n label: msg`Illegal`,\n description: msg`Violates the law of your or the server's country`,\n },\n violation: {\n label: msg`Server rule violation`,\n description: msg`Breaks specific server rules`,\n stampLabel: msg`Violation`,\n },\n other: {\n label: msg`Other`,\n description: msg`Issue doesn't fit other categories`,\n excludeStamp: true,\n },\n};\n\nfunction ReportModal({ account, post, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [username, domain] = account.acct.split('@');\n\n const [rules, currentDomain] = useMemo(() => {\n const { rules, domain } = getCurrentInstance();\n return [rules || [], domain];\n });\n\n const [selectedCategory, setSelectedCategory] = useState(null);\n const [showRules, setShowRules] = useState(false);\n\n const rulesRef = useRef(null);\n const [hasRules, setHasRules] = useState(false);\n\n return (\n <div class=\"report-modal-container\">\n <div class=\"top-controls\">\n <h1>{post ? t`Report Post` : t`Report @${username}`}</h1>\n <button\n type=\"button\"\n class=\"plain4 small\"\n disabled={uiState === 'loading'}\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </button>\n </div>\n <main>\n <div class=\"report-preview\">\n {post ? (\n <Status status={post} size=\"s\" previewMode />\n ) : (\n <AccountBlock\n account={account}\n avatarSize=\"xxl\"\n useAvatarStatic\n showStats\n showActivity\n />\n )}\n </div>\n {!!selectedCategory &&\n !CATEGORIES_INFO[selectedCategory].excludeStamp && (\n <span\n class=\"rubber-stamp\"\n key={selectedCategory}\n aria-hidden=\"true\"\n >\n {_(\n CATEGORIES_INFO[selectedCategory].stampLabel ||\n _(CATEGORIES_INFO[selectedCategory].label),\n )}\n <small>\n <Trans>Pending review</Trans>\n </small>\n </span>\n )}\n <form\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\n let { category, comment, forward } = entries;\n if (!comment) comment = undefined;\n if (forward === 'on') forward = true;\n const ruleIds =\n category === 'violation'\n ? Object.entries(entries)\n .filter(([key]) => key.startsWith('rule_ids'))\n .map(([key, value]) => value)\n : undefined;\n\n const params = {\n category,\n comment,\n forward,\n ruleIds,\n };\n console.log('PARAMS', params);\n\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.reports.create({\n accountId: account.id,\n statusIds: post?.id ? [post.id] : undefined,\n category,\n comment,\n ruleIds,\n forward,\n });\n setUIState('success');\n showToast(post ? t`Post reported` : t`Profile reported`);\n onClose();\n } catch (error) {\n console.error(error);\n setUIState('error');\n showToast(\n error?.message ||\n (post\n ? t`Unable to report post`\n : t`Unable to report profile`),\n );\n }\n })();\n }}\n >\n <p>\n {post\n ? t`What's the issue with this post?`\n : t`What's the issue with this profile?`}\n </p>\n <section class=\"report-categories\">\n {CATEGORIES.map((category) =>\n category === 'violation' && !rules?.length ? null : (\n <Fragment key={category}>\n <label class=\"report-category\">\n <input\n type=\"radio\"\n name=\"category\"\n value={category}\n required\n disabled={uiState === 'loading'}\n onChange={(e) => {\n setSelectedCategory(e.target.value);\n setShowRules(e.target.value === 'violation');\n }}\n />\n <span>\n {_(CATEGORIES_INFO[category].label)} &nbsp;\n <small class=\"ib insignificant\">\n {_(CATEGORIES_INFO[category].description)}\n </small>\n </span>\n </label>\n {category === 'violation' && !!rules?.length && (\n <div\n class=\"shazam-container no-animation\"\n hidden={!showRules}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"report-rules\" ref={rulesRef}>\n {rules.map((rule, i) => (\n <label class=\"report-rule\" key={rule.id}>\n <input\n type=\"checkbox\"\n name={`rule_ids[${i}]`}\n value={rule.id}\n required={showRules && !hasRules}\n disabled={uiState === 'loading'}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n setHasRules(true);\n } else {\n const checkedInputs =\n rulesRef.current.querySelectorAll(\n 'input:checked',\n );\n if (!checkedInputs.length) {\n setHasRules(false);\n }\n }\n }}\n />\n <span>{rule.text}</span>\n </label>\n ))}\n </div>\n </div>\n </div>\n )}\n </Fragment>\n ),\n )}\n </section>\n <section class=\"report-comment\">\n <p>\n <label for=\"report-comment\">\n <Trans>Additional info</Trans>\n </label>\n </p>\n <textarea\n maxlength=\"1000\"\n rows=\"1\"\n name=\"comment\"\n id=\"report-comment\"\n disabled={uiState === 'loading'}\n required={!post} // Required if not reporting a post\n />\n </section>\n {!!domain && domain !== currentDomain && (\n <section>\n <p>\n <label>\n <input\n type=\"checkbox\"\n switch\n name=\"forward\"\n disabled={uiState === 'loading'}\n />{' '}\n <span>\n <Trans>\n Forward to <i>{domain}</i>\n </Trans>\n </span>\n </label>\n </p>\n </section>\n )}\n <footer>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Send Report</Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).mute(); // Infinite duration\n showToast(t`Muted ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to mute ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Mute profile</small>\n </Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).block();\n showToast(t`Blocked ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to block ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Block profile</small>\n </Trans>\n </button>\n <Loader hidden={uiState !== 'loading'} />\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ReportModal;\n","// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>\n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i<alphabet.length ; i++) {\n baseReverseDic[alphabet][alphabet.charAt(i)] = i;\n }\n }\n return baseReverseDic[alphabet][character];\n}\n\nvar LZString = {\n compressToBase64 : function (input) {\n if (input == null) return \"\";\n var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});\n switch (res.length % 4) { // To produce valid Base64\n default: // When could this happen ?\n case 0 : return res;\n case 1 : return res+\"===\";\n case 2 : return res+\"==\";\n case 3 : return res+\"=\";\n }\n },\n\n decompressFromBase64 : function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });\n },\n\n compressToUTF16 : function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 15, function(a){return f(a+32);}) + \" \";\n },\n\n decompressFromUTF16: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });\n },\n\n //compress into uint8array (UCS-2 big endian format)\n compressToUint8Array: function (uncompressed) {\n var compressed = LZString.compress(uncompressed);\n var buf=new Uint8Array(compressed.length*2); // 2 bytes per character\n\n for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {\n var current_value = compressed.charCodeAt(i);\n buf[i*2] = current_value >>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {\n buf[i]=compressed[i*2]*256+compressed[i*2+1];\n }\n\n var result = [];\n buf.forEach(function (c) {\n result.push(f(c));\n });\n return LZString.decompress(result.join(''));\n\n }\n\n },\n\n\n //compress into a string that is already URI encoded\n compressToEncodedURIComponent: function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});\n },\n\n //decompress from an output of compressToEncodedURIComponent\n decompressFromEncodedURIComponent:function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n input = input.replace(/ /g, \"+\");\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });\n },\n\n compress: function (uncompressed) {\n return LZString._compress(uncompressed, 16, function(a){return f(a);});\n },\n _compress: function (uncompressed, bitsPerChar, getCharFromInt) {\n if (uncompressed == null) return \"\";\n var i, value,\n context_dictionary= {},\n context_dictionaryToCreate= {},\n context_c=\"\",\n context_wc=\"\",\n context_w=\"\",\n context_enlargeIn= 2, // Compensate for the first entry which should not count\n context_dictSize= 3,\n context_numBits= 2,\n context_data=[],\n context_data_val=0,\n context_data_position=0,\n ii;\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii);\n if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {\n context_dictionary[context_c] = context_dictSize++;\n context_dictionaryToCreate[context_c] = true;\n }\n\n context_wc = context_w + context_c;\n if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {\n context_w = context_wc;\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position ==bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e\"","import { api } from '../utils/api';\nimport store from '../utils/store';\n\nconst LIMIT = 200;\nconst MAX_FETCH = 10;\n\nexport async function fetchFollowedTags() {\n const { masto } = api();\n const iterator = masto.v1.followedTags.list({\n limit: LIMIT,\n });\n const tags = [];\n let fetchCount = 0;\n do {\n const { value, done } = await iterator.next();\n if (done || value?.length === 0) break;\n tags.push(...value);\n fetchCount++;\n } while (fetchCount < MAX_FETCH);\n tags.sort((a, b) => a.name.localeCompare(b.name));\n console.log(tags);\n\n if (tags.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('followedTags', {\n tags,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return tags;\n}\n\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\nexport async function getFollowedTags() {\n try {\n const { tags, updatedAt } = store.account.get('followedTags') || {};\n if (!tags?.length) return await fetchFollowedTags();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchFollowedTags();\n return tags;\n }\n return tags;\n } catch (e) {\n return [];\n }\n}\n\nconst fauxDiv = document.createElement('div');\nexport const extractTagsFromStatus = (content) => {\n if (!content) return [];\n if (content.indexOf('#') === -1) return [];\n fauxDiv.innerHTML = content;\n const hashtagLinks = fauxDiv.querySelectorAll('a.hashtag');\n if (!hashtagLinks.length) return [];\n return Array.from(hashtagLinks).map((a) =>\n a.innerText.trim().replace(/^[^#]*#+/, ''),\n );\n};\n","import { useEffect, useState } from 'preact/hooks';\n\nfunction AsyncText({ children }) {\n if (typeof children === 'string') return children;\n const [text, setText] = useState('');\n useEffect(() => {\n Promise.resolve(children).then(setText);\n }, [children]);\n return text;\n}\n\nexport default AsyncText;\n","import './shortcuts-settings.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n compressToEncodedURIComponent,\n decompressFromEncodedURIComponent,\n} from 'lz-string';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport floatingButtonUrl from '../assets/floating-button.svg';\nimport multiColumnUrl from '../assets/multi-column.svg';\nimport tabMenuBarUrl from '../assets/tab-menu-bar.svg';\n\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport { getLists, getListTitle } from '../utils/lists';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\nimport Modal from './modal';\n\nexport const SHORTCUTS_LIMIT = 9;\n\nconst TYPES = [\n 'following',\n 'mentions',\n 'notifications',\n 'list',\n 'public',\n 'trending',\n 'search',\n 'hashtag',\n 'bookmarks',\n 'favourites',\n // NOTE: Hide for now\n // 'account-statuses', // Need @acct search first\n];\nconst TYPE_TEXT = {\n following: msg`Home / Following`,\n notifications: msg`Notifications`,\n list: msg`Lists`,\n public: msg`Public (Local / Federated)`,\n search: msg`Search`,\n 'account-statuses': msg`Account`,\n bookmarks: msg`Bookmarks`,\n favourites: msg`Likes`,\n hashtag: msg`Hashtag`,\n trending: msg`Trending`,\n mentions: msg`Mentions`,\n};\nconst TYPE_PARAMS = {\n list: [\n {\n text: msg`List ID`,\n name: 'id',\n notRequired: true,\n },\n ],\n public: [\n {\n text: msg`Local only`,\n name: 'local',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n trending: [\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n search: [\n {\n text: msg`Search term`,\n name: 'query',\n type: 'text',\n placeholder: msg`Optional, unless for multi-column mode`,\n notRequired: true,\n },\n ],\n 'account-statuses': [\n {\n text: '@',\n name: 'id',\n type: 'text',\n placeholder: 'cheeaun@mastodon.social',\n },\n ],\n hashtag: [\n {\n text: '#',\n name: 'hashtag',\n type: 'text',\n placeholder: msg`e.g. PixelArt (Max 5, space-separated)`,\n pattern: '[^#]+',\n },\n {\n text: msg`Media only`,\n name: 'media',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n};\nconst fetchAccountTitle = pmem(async ({ id }) => {\n const account = await api().masto.v1.accounts.$select(id).fetch();\n return account.username || account.acct || account.displayName;\n});\nexport const SHORTCUTS_META = {\n following: {\n id: 'home',\n title: (_, index) =>\n index === 0\n ? t`Home`\n : t({ id: 'following.title', message: 'Following' }),\n path: '/',\n icon: 'home',\n },\n mentions: {\n id: 'mentions',\n title: msg`Mentions`,\n path: '/mentions',\n icon: 'at',\n },\n notifications: {\n id: 'notifications',\n title: msg`Notifications`,\n path: '/notifications',\n icon: 'notification',\n },\n list: {\n id: ({ id }) => (id ? 'list' : 'lists'),\n title: ({ id }) => (id ? getListTitle(id) : t`Lists`),\n path: ({ id }) => (id ? `/l/${id}` : '/l'),\n icon: 'list',\n excludeViewMode: ({ id }) => (!id ? ['multi-column'] : []),\n },\n public: {\n id: 'public',\n title: ({ local }) => (local ? t`Local` : t`Federated`),\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ local, instance }) => `/${instance}/p${local ? '/l' : ''}`,\n icon: ({ local }) => (local ? 'building' : 'earth'),\n },\n trending: {\n id: 'trending',\n title: msg`Trending`,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ instance }) => `/${instance}/trending`,\n icon: 'chart',\n },\n search: {\n id: 'search',\n title: ({ query }) => (query ? `“${query}”` : t`Search`),\n path: ({ query }) =>\n query\n ? `/search?q=${encodeURIComponent(query)}&type=statuses`\n : '/search',\n icon: 'search',\n excludeViewMode: ({ query }) => (!query ? ['multi-column'] : []),\n },\n 'account-statuses': {\n id: 'account-statuses',\n title: fetchAccountTitle,\n path: ({ id }) => `/a/${id}`,\n icon: 'user',\n },\n bookmarks: {\n id: 'bookmarks',\n title: msg`Bookmarks`,\n path: '/b',\n icon: 'bookmark',\n },\n favourites: {\n id: 'favourites',\n title: msg`Likes`,\n path: '/f',\n icon: 'heart',\n },\n hashtag: {\n id: 'hashtag',\n title: ({ hashtag }) => hashtag,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ hashtag, instance, media }) =>\n `${instance ? `/${instance}` : ''}/t/${hashtag.split(/\\s+/).join('+')}${\n media ? '?media=1' : ''\n }`,\n icon: 'hashtag',\n },\n};\n\nfunction ShortcutsSettings({ onClose }) {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n const [showForm, setShowForm] = useState(false);\n const [showImportExport, setShowImportExport] = useState(false);\n\n const [shortcutsListParent] = useAutoAnimate();\n\n return (\n <div id=\"shortcuts-settings-container\" class=\"sheet\" tabindex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Icon icon=\"shortcut\" /> <Trans>Shortcuts</Trans>{' '}\n <sup\n style={{\n fontSize: 12,\n opacity: 0.5,\n textTransform: 'uppercase',\n }}\n >\n <Trans>beta</Trans>\n </sup>\n </h2>\n </header>\n <main>\n <p>\n <Trans>Specify a list of shortcuts that'll appear&nbsp;as:</Trans>\n </p>\n <div class=\"shortcuts-view-mode\">\n {[\n {\n value: 'float-button',\n label: t`Floating button`,\n imgURL: floatingButtonUrl,\n },\n {\n value: 'tab-menu-bar',\n label: t`Tab/Menu bar`,\n imgURL: tabMenuBarUrl,\n },\n {\n value: 'multi-column',\n label: t`Multi-column`,\n imgURL: multiColumnUrl,\n },\n ].map(({ value, label, imgURL }) => {\n const checked =\n snapStates.settings.shortcutsViewMode === value ||\n (value === 'float-button' &&\n !snapStates.settings.shortcutsViewMode);\n return (\n <label key={value} class={checked ? 'checked' : ''}>\n <input\n type=\"radio\"\n name=\"shortcuts-view-mode\"\n value={value}\n checked={checked}\n onChange={(e) => {\n states.settings.shortcutsViewMode = e.target.value;\n }}\n />{' '}\n <img src={imgURL} alt=\"\" width=\"80\" height=\"58\" />{' '}\n <span>{label}</span>\n </label>\n );\n })}\n </div>\n {shortcuts.length > 0 ? (\n <>\n <ol class=\"shortcuts-list\" ref={shortcutsListParent}>\n {shortcuts.filter(Boolean).map((shortcut, i) => {\n // const key = i + Object.values(shortcut);\n const key = Object.values(shortcut).join('-');\n const { type } = shortcut;\n if (!SHORTCUTS_META[type]) return null;\n let { icon, title, subtitle, excludeViewMode } =\n SHORTCUTS_META[type];\n if (typeof title === 'function') {\n title = title(shortcut, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(shortcut, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(shortcut, i);\n }\n if (typeof excludeViewMode === 'function') {\n excludeViewMode = excludeViewMode(shortcut, i);\n }\n const excludedViewMode = excludeViewMode?.includes(\n snapStates.settings.shortcutsViewMode,\n );\n return (\n <li key={key}>\n <Icon icon={icon} />\n <span class=\"shortcut-text\">\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n {' '}\n <small class=\"ib insignificant\">{subtitle}</small>\n </>\n )}\n {excludedViewMode && (\n <span class=\"tag\">\n <Trans>Not available in current view mode</Trans>\n </span>\n )}\n </span>\n <span class=\"shortcut-actions\">\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === 0}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i > 0) {\n const temp = states.shortcuts[i - 1];\n shortcutsArr[i - 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-up\" alt={t`Move up`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === shortcuts.length - 1}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i < states.shortcuts.length - 1) {\n const temp = states.shortcuts[i + 1];\n shortcutsArr[i + 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-down\" alt={t`Move down`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n setShowForm({\n shortcut,\n shortcutIndex: i,\n });\n }}\n >\n <Icon icon=\"pencil\" alt={t`Edit`} />\n </button>\n {/* <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n states.shortcuts.splice(i, 1);\n }}\n >\n <Icon icon=\"x\" alt=\"Remove\" />\n </button> */}\n </span>\n </li>\n );\n })}\n </ol>\n {shortcuts.length === 1 &&\n snapStates.settings.shortcutsViewMode !== 'float-button' && (\n <div class=\"ui-state insignificant\">\n <Icon icon=\"info\" />{' '}\n <small>\n <Trans>\n Add more than one shortcut/column to make this work.\n </Trans>\n </small>\n </div>\n )}\n </>\n ) : (\n <div class=\"ui-state insignificant\">\n <p>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`No columns yet. Tap on the Add column button.`\n : t`No shortcuts yet. Tap on the Add shortcut button.`}\n </p>\n <p>\n <Trans>\n Not sure what to add?\n <br />\n Try adding{' '}\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n states.shortcuts = [\n {\n type: 'following',\n },\n {\n type: 'notifications',\n },\n ];\n }}\n >\n Home / Following and Notifications\n </a>{' '}\n first.\n </Trans>\n </p>\n </div>\n )}\n <p class=\"insignificant\">\n {shortcuts.length >= SHORTCUTS_LIMIT &&\n (snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Max ${SHORTCUTS_LIMIT} columns`\n : t`Max ${SHORTCUTS_LIMIT} shortcuts`)}\n </p>\n <p\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => setShowImportExport(true)}\n >\n <Trans>Import/export</Trans>\n </button>\n <button\n type=\"button\"\n disabled={shortcuts.length >= SHORTCUTS_LIMIT}\n onClick={() => setShowForm(true)}\n >\n <Icon icon=\"plus\" />{' '}\n <span>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Add column…`\n : t`Add shortcut…`}\n </span>\n </button>\n </p>\n </main>\n {showForm && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowForm(false);\n }\n }}\n >\n <ShortcutForm\n shortcut={showForm.shortcut}\n shortcutIndex={showForm.shortcutIndex}\n onSubmit={({ result, mode }) => {\n console.log('onSubmit', result);\n if (mode === 'edit') {\n states.shortcuts[showForm.shortcutIndex] = result;\n } else {\n states.shortcuts.push(result);\n }\n }}\n onClose={() => setShowForm(false)}\n />\n </Modal>\n )}\n {showImportExport && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowImportExport(false);\n }\n }}\n >\n <ImportExport\n shortcuts={shortcuts}\n onClose={() => setShowImportExport(false)}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nconst FORM_NOTES = {\n list: msg`Specific list is optional. For multi-column mode, list is required, else the column will not be shown.`,\n search: msg`For multi-column mode, search term is required, else the column will not be shown.`,\n hashtag: msg`Multiple hashtags are supported. Space-separated.`,\n};\n\nfunction ShortcutForm({\n onSubmit,\n disabled,\n shortcut,\n shortcutIndex,\n onClose,\n}) {\n const { _ } = useLingui();\n console.log('shortcut', shortcut);\n const editMode = !!shortcut;\n const [currentType, setCurrentType] = useState(shortcut?.type || null);\n\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n (async () => {\n if (currentType !== 'list') return;\n try {\n setUIState('loading');\n const lists = await getLists();\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n (async () => {\n if (currentType !== 'hashtag') return;\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [currentType]);\n\n const formRef = useRef();\n useEffect(() => {\n if (editMode && currentType && TYPE_PARAMS[currentType]) {\n // Populate form\n const form = formRef.current;\n TYPE_PARAMS[currentType].forEach(({ name, type }) => {\n const input = form.querySelector(`[name=\"${name}\"]`);\n if (input && shortcut[name]) {\n if (type === 'checkbox') {\n input.checked = shortcut[name] === 'on' ? true : false;\n } else {\n input.value = shortcut[name];\n }\n }\n });\n }\n }, [editMode, currentType]);\n\n return (\n <div id=\"shortcut-settings-form\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>{editMode ? t`Edit shortcut` : t`Add shortcut`}</h2>\n </header>\n <main tabindex=\"-1\">\n <form\n ref={formRef}\n onSubmit={(e) => {\n // Construct a nice object from form\n e.preventDefault();\n const data = new FormData(e.target);\n const result = {};\n data.forEach((value, key) => {\n result[key] = value?.trim();\n if (key === 'instance') {\n // Remove protocol and trailing slash\n result[key] = result[key]\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '');\n // Remove @acct@ or acct@ from instance URL\n result[key] = result[key].replace(/^@?[^@]+@/, '');\n }\n });\n console.log('result', result);\n if (!result.type) return;\n onSubmit({\n result,\n mode: editMode ? 'edit' : 'add',\n });\n // Reset\n e.target.reset();\n setCurrentType(null);\n onClose?.();\n }}\n >\n <p>\n <label>\n <span>\n <Trans>Timeline</Trans>\n </span>\n <select\n required\n disabled={disabled}\n onChange={(e) => {\n setCurrentType(e.target.value);\n }}\n defaultValue={editMode ? shortcut.type : undefined}\n name=\"type\"\n dir=\"auto\"\n >\n <option></option>\n {TYPES.map((type) => (\n <option value={type}>{_(TYPE_TEXT[type])}</option>\n ))}\n </select>\n </label>\n </p>\n {TYPE_PARAMS[currentType]?.map?.(\n ({ text, name, type, placeholder, pattern, notRequired }) => {\n if (currentType === 'list') {\n return (\n <p>\n <label>\n <span>\n <Trans>List</Trans>\n </span>\n <select\n name=\"id\"\n required={!notRequired}\n disabled={disabled || uiState === 'loading'}\n defaultValue={editMode ? shortcut.id : undefined}\n dir=\"auto\"\n >\n <option value=\"\"></option>\n {lists.map((list) => (\n <option value={list.id}>{list.title}</option>\n ))}\n </select>\n </label>\n </p>\n );\n }\n\n return (\n <p>\n <label>\n <span>{_(text)}</span>{' '}\n <input\n type={type}\n switch={type === 'checkbox' || undefined}\n name={name}\n placeholder={_(placeholder)}\n required={type === 'text' && !notRequired}\n disabled={disabled}\n list={\n currentType === 'hashtag'\n ? 'followed-hashtags-datalist'\n : null\n }\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n pattern={pattern}\n dir=\"auto\"\n />\n {currentType === 'hashtag' &&\n followedHashtags.length > 0 && (\n <datalist id=\"followed-hashtags-datalist\">\n {followedHashtags.map((tag) => (\n <option value={tag.name} />\n ))}\n </datalist>\n )}\n </label>\n </p>\n );\n },\n )}\n {!!FORM_NOTES[currentType] && (\n <p class=\"form-note insignificant\">\n <Icon icon=\"info\" />\n {_(FORM_NOTES[currentType])}\n </p>\n )}\n <footer>\n <button\n type=\"submit\"\n class=\"block\"\n disabled={disabled || uiState === 'loading'}\n >\n {editMode ? t`Save` : t`Add`}\n </button>\n {editMode && (\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {\n states.shortcuts.splice(shortcutIndex, 1);\n onClose?.();\n }}\n >\n <Trans>Remove</Trans>\n </button>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ImportExport({ shortcuts, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const shortcutsStr = useMemo(() => {\n if (!shortcuts) return '';\n if (!shortcuts.filter(Boolean).length) return '';\n return compressToEncodedURIComponent(\n JSON.stringify(shortcuts.filter(Boolean)),\n );\n }, [shortcuts]);\n const [importShortcutStr, setImportShortcutStr] = useState('');\n const [importUIState, setImportUIState] = useState('default');\n const parsedImportShortcutStr = useMemo(() => {\n if (!importShortcutStr) {\n setImportUIState('default');\n return null;\n }\n try {\n const parsed = JSON.parse(\n decompressFromEncodedURIComponent(importShortcutStr),\n );\n // Very basic validation, I know\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n // Fallback to JSON string parsing\n // There's a chance that someone might want to import a JSON string instead of the compressed version\n try {\n const parsed = JSON.parse(importShortcutStr);\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n setImportUIState('error');\n return null;\n }\n }\n }, [importShortcutStr]);\n const hasCurrentSettings = states.shortcuts.length > 0;\n\n const shortcutsImportFieldRef = useRef();\n\n return (\n <div id=\"import-export-container\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>\n Import/Export <small class=\"ib insignificant\">Shortcuts</small>\n </Trans>\n </h2>\n </header>\n <main tabindex=\"-1\">\n <section>\n <h3>\n <Icon icon=\"arrow-down-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Import</Trans>\n </span>\n </h3>\n <p class=\"field-button\">\n <input\n ref={shortcutsImportFieldRef}\n type=\"text\"\n name=\"import\"\n placeholder={t`Paste shortcuts here`}\n class=\"block\"\n onInput={(e) => {\n setImportShortcutStr(e.target.value);\n }}\n dir=\"auto\"\n />\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2 small\"\n disabled={importUIState === 'cloud-downloading'}\n onClick={async () => {\n setImportUIState('cloud-downloading');\n const currentAccount = getCurrentAccountID();\n showToast(\n t`Downloading saved shortcuts from instance server…`,\n );\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n const settings = note.match(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n )[1];\n const { v, dt, data } = JSON.parse(settings);\n shortcutsImportFieldRef.current.value = data;\n shortcutsImportFieldRef.current.dispatchEvent(\n new Event('input'),\n );\n }\n }\n setImportUIState('default');\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to download shortcuts`);\n }\n }}\n title={t`Download shortcuts from instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-down\" />\n </button>\n )}\n </p>\n {!!parsedImportShortcutStr &&\n Array.isArray(parsedImportShortcutStr) && (\n <>\n <p>\n <b>{parsedImportShortcutStr.length}</b> shortcut\n {parsedImportShortcutStr.length > 1 ? 's' : ''}{' '}\n <small class=\"insignificant\">\n ({importShortcutStr.length} characters)\n </small>\n </p>\n <ol class=\"import-settings-list\">\n {parsedImportShortcutStr.map((shortcut) => (\n <li>\n <span\n style={{\n opacity: shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n )\n ? 1\n : 0,\n }}\n >\n *\n </span>\n <span>\n {_(TYPE_TEXT[shortcut.type])}\n {shortcut.type === 'list' && ' ⚠️'}{' '}\n {TYPE_PARAMS[shortcut.type]?.map?.(\n ({ text, name, type }) =>\n shortcut[name] ? (\n <>\n <span class=\"tag collapsed insignificant\">\n {text}:{' '}\n {type === 'checkbox'\n ? shortcut[name] === 'on'\n ? '✅'\n : '❌'\n : shortcut[name]}\n </span>{' '}\n </>\n ) : null,\n )}\n </span>\n </li>\n ))}\n </ol>\n <p>\n <small>\n <Trans>* Exists in current shortcuts</Trans>\n </small>\n <br />\n <small>\n ⚠️{' '}\n <Trans>\n List may not work if it's from a different account.\n </Trans>\n </small>\n </p>\n </>\n )}\n {importUIState === 'error' && (\n <p class=\"error\">\n <small>\n ⚠️ <Trans>Invalid settings format</Trans>\n </small>\n </p>\n )}\n <p>\n {hasCurrentSettings && (\n <>\n <MenuConfirm\n confirmLabel={t`Append to current shortcuts?`}\n menuFooter={\n <div class=\"footer\">\n <Trans>\n Only shortcuts that dont exist in current shortcuts\n will be appended.\n </Trans>\n </div>\n }\n onClick={() => {\n // states.shortcuts = [\n // ...states.shortcuts,\n // ...parsedImportShortcutStr,\n // ];\n // Append non-unique shortcuts only\n const nonUniqueShortcuts = parsedImportShortcutStr.filter(\n (shortcut) =>\n !states.shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n ),\n );\n if (!nonUniqueShortcuts.length) {\n showToast(t`No new shortcuts to import`);\n return;\n }\n let newShortcuts = [\n ...states.shortcuts,\n ...nonUniqueShortcuts,\n ];\n const exceededLimit = newShortcuts.length > SHORTCUTS_LIMIT;\n if (exceededLimit) {\n // If exceeded, trim it\n newShortcuts = newShortcuts.slice(0, SHORTCUTS_LIMIT);\n }\n states.shortcuts = newShortcuts;\n showToast(\n exceededLimit\n ? t`Shortcuts imported. Exceeded max ${SHORTCUTS_LIMIT}, so the rest are not imported.`\n : t`Shortcuts imported`,\n );\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n <Trans>Import & append…</Trans>\n </button>\n </MenuConfirm>{' '}\n </>\n )}\n <MenuConfirm\n confirmLabel={\n hasCurrentSettings\n ? t`Override current shortcuts?`\n : t`Import shortcuts?`\n }\n menuItemClassName={hasCurrentSettings ? 'danger' : undefined}\n onClick={() => {\n states.shortcuts = parsedImportShortcutStr;\n showToast(t`Shortcuts imported`);\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n {hasCurrentSettings ? t`or override…` : t`Import…`}\n </button>\n </MenuConfirm>\n </p>\n </section>\n <section>\n <h3>\n <Icon icon=\"arrow-up-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Export</Trans>\n </span>\n </h3>\n <p>\n <input\n style={{ width: '100%' }}\n type=\"text\"\n value={shortcutsStr}\n readOnly\n onClick={(e) => {\n if (!e.target.value) return;\n e.target.select();\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Shortcuts copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcuts`);\n }\n }}\n dir=\"auto\"\n />\n </p>\n <p>\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.clipboard.writeText(shortcutsStr);\n showToast(t`Shortcut settings copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcut settings`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />{' '}\n <span>\n <Trans>Copy</Trans>\n </span>\n </button>{' '}\n {navigator?.share &&\n navigator?.canShare?.({\n text: shortcutsStr,\n }) && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.share({\n text: shortcutsStr,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />{' '}\n <span>\n <Trans>Share</Trans>\n </span>\n </button>\n )}{' '}\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={importUIState === 'cloud-uploading'}\n onClick={async () => {\n setImportUIState('cloud-uploading');\n const currentAccount = getCurrentAccountID();\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n // const newNote = `${note}\\n\\n\\n$<phanpy-shortcuts-settings>{shortcutsStr}</phanpy-shortcuts-settings>`;\n let newNote = '';\n const settingsJSON = JSON.stringify({\n v: '1', // version\n dt: Date.now(), // datetime stamp\n data: shortcutsStr, // shortcuts settings string\n });\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n newNote = note.replace(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n `<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`,\n );\n } else {\n newNote = `${note}\\n\\n\\n<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;\n }\n showToast(t`Saving shortcuts to instance server…`);\n await masto.v1.accounts\n .$select(currentAccount)\n .note.create({\n comment: newNote,\n });\n setImportUIState('default');\n showToast(t`Shortcuts saved`);\n }\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to save shortcuts`);\n }\n }}\n title={t`Sync to instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-up\" />\n </button>\n )}{' '}\n {shortcutsStr.length > 0 && (\n <small class=\"insignificant ib\">\n <Plural\n value={shortcutsStr.length}\n one=\"# character\"\n other=\"# characters\"\n />\n </small>\n )}\n </p>\n {!!shortcutsStr && (\n <details>\n <summary class=\"insignificant\">\n <small>\n <Trans>Raw Shortcuts JSON</Trans>\n </small>\n </summary>\n <textarea style={{ width: '100%' }} rows={10} readOnly>\n {JSON.stringify(shortcuts.filter(Boolean), null, 2)}\n </textarea>\n </details>\n )}\n </section>\n {states.settings.shortcutSettingsCloudImportExport && (\n <footer>\n <p>\n <Icon icon=\"cloud\" />{' '}\n <Trans>\n Import/export settings from/to instance server (Very\n experimental)\n </Trans>\n </p>\n </footer>\n )}\n </main>\n </div>\n );\n}\n\nexport default ShortcutsSettings;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { subscribe, useSnapshot } from 'valtio';\n\nimport Accounts from '../pages/accounts';\nimport Settings from '../pages/settings';\nimport focusDeck from '../utils/focus-deck';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\n\nimport AccountSheet from './account-sheet';\nimport ComposeSuspense, { preload } from './compose-suspense';\nimport Drafts from './drafts';\nimport EmbedModal from './embed-modal';\nimport GenericAccounts from './generic-accounts';\nimport MediaAltModal from './media-alt-modal';\nimport MediaModal from './media-modal';\nimport Modal from './modal';\nimport ReportModal from './report-modal';\nimport ShortcutsSettings from './shortcuts-settings';\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // When closing modal, focus on deck\n if (/^show/i.test(path) && !value) {\n focusDeck();\n }\n }\n});\n\nexport default function Modals() {\n const snapStates = useSnapshot(states);\n const navigate = useNavigate();\n const location = useLocation();\n\n useEffect(() => {\n setTimeout(preload, 1000);\n }, []);\n\n return (\n <>\n {!!snapStates.showCompose && (\n <Modal\n class={`solid ${snapStates.composerState.minimized ? 'min' : ''}`}\n minimized={!!snapStates.composerState.minimized}\n >\n <ComposeSuspense\n replyToStatus={\n typeof snapStates.showCompose !== 'boolean'\n ? snapStates.showCompose.replyToStatus\n : window.__COMPOSE__?.replyToStatus || null\n }\n editStatus={\n states.showCompose?.editStatus ||\n window.__COMPOSE__?.editStatus ||\n null\n }\n draftStatus={\n states.showCompose?.draftStatus ||\n window.__COMPOSE__?.draftStatus ||\n null\n }\n onClose={(results) => {\n const { newStatus, instance, type } = results || {};\n states.showCompose = false;\n window.__COMPOSE__ = null;\n if (newStatus) {\n states.reloadStatusPage++;\n showToast({\n text: {\n post: t`Post published. Check it out.`,\n reply: t`Reply posted. Check it out.`,\n edit: t`Post updated. Check it out.`,\n }[type || 'post'],\n delay: 1000,\n duration: 10_000, // 10 seconds\n onClick: (toast) => {\n toast.hideToast();\n states.prevLocation = location;\n navigate(\n instance\n ? `/${instance}/s/${newStatus.id}`\n : `/s/${newStatus.id}`,\n );\n },\n });\n }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showSettings && (\n <Modal\n onClose={() => {\n states.showSettings = false;\n }}\n >\n <Settings\n onClose={() => {\n states.showSettings = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccounts && (\n <Modal\n onClose={() => {\n states.showAccounts = false;\n }}\n >\n <Accounts\n onClose={() => {\n states.showAccounts = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccount && (\n <Modal\n onClose={() => {\n states.showAccount = false;\n }}\n >\n <AccountSheet\n account={snapStates.showAccount?.account || snapStates.showAccount}\n instance={snapStates.showAccount?.instance}\n onClose={({ destination } = {}) => {\n states.showAccount = false;\n // states.showGenericAccounts = false;\n // if (destination) {\n // states.showAccounts = false;\n // }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showDrafts && (\n <Modal\n onClose={() => {\n states.showDrafts = false;\n }}\n >\n <Drafts onClose={() => (states.showDrafts = false)} />\n </Modal>\n )}\n {!!snapStates.showMediaModal && (\n <Modal\n onClick={(e) => {\n if (\n e.target === e.currentTarget ||\n e.target.classList.contains('media')\n ) {\n states.showMediaModal = false;\n }\n }}\n >\n <MediaModal\n mediaAttachments={snapStates.showMediaModal.mediaAttachments}\n instance={snapStates.showMediaModal.instance}\n index={snapStates.showMediaModal.index}\n statusID={snapStates.showMediaModal.statusID}\n onClose={() => {\n states.showMediaModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showShortcutsSettings && (\n <Modal\n onClose={() => {\n states.showShortcutsSettings = false;\n }}\n >\n <ShortcutsSettings\n onClose={() => (states.showShortcutsSettings = false)}\n />\n </Modal>\n )}\n {!!snapStates.showGenericAccounts && (\n <Modal\n onClose={() => {\n states.showGenericAccounts = false;\n }}\n >\n <GenericAccounts\n instance={snapStates.showGenericAccounts.instance}\n excludeRelationshipAttrs={\n snapStates.showGenericAccounts.excludeRelationshipAttrs\n }\n postID={snapStates.showGenericAccounts.postID}\n onClose={() => (states.showGenericAccounts = false)}\n blankCopy={snapStates.showGenericAccounts.blankCopy}\n />\n </Modal>\n )}\n {!!snapStates.showMediaAlt && (\n <Modal\n onClose={(e) => {\n states.showMediaAlt = false;\n }}\n >\n <MediaAltModal\n alt={snapStates.showMediaAlt.alt || snapStates.showMediaAlt}\n lang={snapStates.showMediaAlt?.lang}\n onClose={() => {\n states.showMediaAlt = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showEmbedModal && (\n <Modal\n class=\"solid\"\n onClose={() => {\n states.showEmbedModal = false;\n }}\n >\n <EmbedModal\n html={snapStates.showEmbedModal.html}\n url={snapStates.showEmbedModal.url}\n width={snapStates.showEmbedModal.width}\n height={snapStates.showEmbedModal.height}\n onClose={() => {\n states.showEmbedModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showReportModal && (\n <Modal\n onClose={() => {\n states.showReportModal = false;\n }}\n >\n <ReportModal\n account={snapStates.showReportModal.account}\n post={snapStates.showReportModal.post}\n onClose={() => {\n states.showReportModal = false;\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Loader from './loader';\n\nfunction FollowRequestButtons({ accountID, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, reject\n const [relationship, setRelationship] = useState(null);\n\n const hasRelationship = relationship !== null;\n\n return (\n <p class=\"follow-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n onClick={() => {\n setUIState('loading');\n setRequestState('accept');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .authorize();\n if (!rel?.followedBy) {\n throw new Error('Follow request not accepted');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n }\n setUIState('default');\n })();\n }}\n >\n <Trans>Accept</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n setRequestState('reject');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .reject();\n if (rel?.followedBy) {\n throw new Error('Follow request not rejected');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n setUIState('default');\n }\n })();\n }}\n >\n <Trans>Reject</Trans>\n </button>\n <span class=\"follow-request-states\">\n {hasRelationship && requestState ? (\n requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"follow-accepted\"\n />\n ) : (\n <Icon icon=\"x-circle\" alt={t`Rejected`} class=\"follow-rejected\" />\n )\n ) : (\n <Loader hidden={uiState !== 'loading'} />\n )}\n </span>\n </p>\n );\n}\n\nexport default FollowRequestButtons;\n","import { msg, Plural, Select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\n\nimport { api } from '../utils/api';\nimport { isFiltered } from '../utils/filters';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { statusKey } from '../utils/states';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport useTruncated from '../utils/useTruncated';\n\nimport Avatar from './avatar';\nimport CustomEmoji from './custom-emoji';\nimport FollowRequestButtons from './follow-request-buttons';\nimport Icon from './icon';\nimport Link from './link';\nimport NameText from './name-text';\nimport Status from './status';\n\nconst NOTIFICATION_ICONS = {\n mention: 'comment',\n status: 'notification',\n reblog: 'rocket',\n follow: 'follow',\n follow_request: 'follow-add',\n favourite: 'heart',\n poll: 'poll',\n update: 'pencil',\n 'admin.signup': 'account-edit',\n 'admin.report': 'account-warning',\n severed_relationships: 'heart-break',\n moderation_warning: 'alert',\n emoji_reaction: 'emoji2',\n 'pleroma:emoji_reaction': 'emoji2',\n};\n\n/*\nNotification types\n==================\nmention = Someone mentioned you in their status\nstatus = Someone you enabled notifications for has posted a status\nreblog = Someone boosted one of your statuses\nfollow = Someone followed you\nfollow_request = Someone requested to follow you\nfavourite = Someone favourited one of your statuses\npoll = A poll you have voted in or created has ended\nupdate = A status you interacted with has been edited\nadmin.sign_up = Someone signed up (optionally sent to admins)\nadmin.report = A new report has been filed\nsevered_relationships = Severed relationships\nmoderation_warning = Moderation warning\n*/\n\nfunction emojiText({ account, emoji, emoji_url }) {\n let url;\n let staticUrl;\n if (typeof emoji_url === 'string') {\n url = emoji_url;\n } else {\n url = emoji_url?.url;\n staticUrl = emoji_url?.staticUrl;\n }\n const emojiObject = url ? (\n <CustomEmoji url={url} staticUrl={staticUrl} alt={emoji} />\n ) : (\n emoji\n );\n return (\n <Trans>\n {account} reacted to your post with {emojiObject}\n </Trans>\n );\n}\n\nconst contentText = {\n status: ({ account }) => <Trans>{account} published a post.</Trans>,\n reblog: ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted your reply.</Trans>}\n other={<Trans>{account} boosted your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your post.\n </Trans>\n }\n />\n }\n />\n ),\n follow: ({ account, count, components: { Subject } }) => (\n <Plural\n value={count}\n _1={<Trans>{account} followed you.</Trans>}\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n followed you.\n </Trans>\n }\n />\n ),\n follow_request: ({ account }) => (\n <Trans>{account} requested to follow you.</Trans>\n ),\n favourite: ({\n account,\n count,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} liked your reply.</Trans>}\n other={<Trans>{account} liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n poll: () => t`A poll you have voted in or created has ended.`,\n 'poll-self': () => t`A poll you have created has ended.`,\n 'poll-voted': () => t`A poll you have voted in has ended.`,\n update: () => t`A post you interacted with has been edited.`,\n 'favourite+reblog': ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted & liked your reply.</Trans>}\n other={<Trans>{account} boosted & liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted & liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n 'admin.sign_up': ({ account }) => <Trans>{account} signed up.</Trans>,\n 'admin.report': ({ account, targetAccount }) => (\n <Trans>\n {account} reported {targetAccount}\n </Trans>\n ),\n severed_relationships: ({ name }) => (\n <Trans>\n Lost connections with <i>{name}</i>.\n </Trans>\n ),\n moderation_warning: () => (\n <b>\n <Trans>Moderation warning</Trans>\n </b>\n ),\n emoji_reaction: emojiText,\n 'pleroma:emoji_reaction': emojiText,\n};\n\n// account_suspension, domain_block, user_domain_block\nconst SEVERED_RELATIONSHIPS_TEXT = {\n account_suspension: ({ from, targetName }) => (\n <Trans>\n An admin from <i>{from}</i> has suspended <i>{targetName}</i>, which means\n you can no longer receive updates from them or interact with them.\n </Trans>\n ),\n domain_block: ({ from, targetName, followersCount, followingCount }) => (\n <Trans>\n An admin from <i>{from}</i> has blocked <i>{targetName}</i>. Affected\n followers: {followersCount}, followings: {followingCount}.\n </Trans>\n ),\n user_domain_block: ({ targetName, followersCount, followingCount }) => (\n <Trans>\n You have blocked <i>{targetName}</i>. Removed followers: {followersCount},\n followings: {followingCount}.\n </Trans>\n ),\n};\n\nconst MODERATION_WARNING_TEXT = {\n none: msg`Your account has received a moderation warning.`,\n disable: msg`Your account has been disabled.`,\n mark_statuses_as_sensitive: msg`Some of your posts have been marked as sensitive.`,\n delete_statuses: msg`Some of your posts have been deleted.`,\n sensitive: msg`Your posts will be marked as sensitive from now on.`,\n silence: msg`Your account has been limited.`,\n suspend: msg`Your account has been suspended.`,\n};\n\nconst AVATARS_LIMIT = 30;\n\nfunction Notification({\n notification,\n instance,\n isStatic,\n disableContextMenu,\n}) {\n const { _ } = useLingui();\n const { masto } = api();\n const {\n id,\n status,\n account,\n report,\n event,\n moderation_warning,\n // Client-side grouped notification\n _ids,\n _accounts,\n _statuses,\n _groupKeys,\n // Server-side grouped notification\n sampleAccounts,\n notificationsCount,\n groupKey,\n } = notification;\n let { type } = notification;\n\n if (type === 'mention' && !status) {\n // Could be deleted\n return null;\n }\n\n // status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update\n const actualStatus = status?.reblog || status;\n const actualStatusID = actualStatus?.id;\n\n const currentAccount = getCurrentAccountID();\n const isSelf = currentAccount === account?.id;\n const isVoted = status?.poll?.voted;\n const isReplyToOthers =\n !!status?.inReplyToAccountId &&\n status?.inReplyToAccountId !== currentAccount &&\n status?.account?.id === currentAccount;\n\n let favsCount = 0;\n let reblogsCount = 0;\n if (type === 'favourite+reblog') {\n if (_accounts) {\n for (const account of _accounts) {\n if (account._types?.includes('favourite')) {\n favsCount++;\n }\n if (account._types?.includes('reblog')) {\n reblogsCount++;\n }\n }\n }\n if (!reblogsCount && favsCount) type = 'favourite';\n if (!favsCount && reblogsCount) type = 'reblog';\n }\n\n let text;\n if (type === 'poll') {\n text = contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll'];\n } else if (contentText[type]) {\n text = contentText[type];\n } else {\n // Anticipate unhandled notification types, possibly from Mastodon forks or non-Mastodon instances\n // This surfaces the error to the user, hoping that users will report it\n text = t`[Unknown notification type: ${type}]`;\n }\n\n const Subject = ({ clickable, ...props }) =>\n clickable ? (\n <b tabIndex=\"0\" onClick={handleOpenGenericAccounts} {...props} />\n ) : (\n <b {...props} />\n );\n\n if (typeof text === 'function') {\n const count =\n _accounts?.length || sampleAccounts?.length || (account ? 1 : 0);\n const postsCount = _statuses?.length || (status ? 1 : 0);\n if (type === 'admin.report') {\n const targetAccount = report?.targetAccount;\n if (targetAccount) {\n text = text({\n account: <NameText account={account} showAvatar />,\n targetAccount: <NameText account={targetAccount} showAvatar />,\n });\n }\n } else if (type === 'severed_relationships') {\n const targetName = event?.targetName;\n if (targetName) {\n text = text({ name: targetName });\n }\n } else if (\n (type === 'emoji_reaction' || type === 'pleroma:emoji_reaction') &&\n notification.emoji\n ) {\n const emojiURL =\n notification.emoji_url || // This is string\n status?.emojis?.find?.(\n (emoji) =>\n emoji?.shortcode ===\n notification.emoji.replace(/^:/, '').replace(/:$/, ''),\n ); // Emoji object instead of string\n text = text({\n account: <NameText account={account} showAvatar />,\n emoji: notification.emoji,\n emojiURL,\n });\n } else {\n text = text({\n account: account ? (\n <NameText account={account} showAvatar />\n ) : (\n sampleAccounts?.[0] && (\n <NameText account={sampleAccounts[0]} showAvatar />\n )\n ),\n count,\n postsCount,\n postType: isReplyToOthers ? 'reply' : 'post',\n components: { Subject },\n });\n }\n }\n\n const formattedCreatedAt =\n notification.createdAt && new Date(notification.createdAt).toLocaleString();\n\n const genericAccountsHeading =\n {\n 'favourite+reblog': t`Boosted/Liked by…`,\n favourite: t`Liked by…`,\n reblog: t`Boosted by…`,\n follow: t`Followed by…`,\n }[type] || t`Accounts`;\n const handleOpenGenericAccounts = () => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n accounts: _accounts,\n showReactions: type === 'favourite+reblog',\n excludeRelationshipAttrs: type === 'follow' ? ['followedBy'] : [],\n postID: statusKey(actualStatusID, instance),\n };\n };\n\n console.debug('RENDER Notification', notification.id);\n\n const diffCount =\n notificationsCount > 0 && notificationsCount > sampleAccounts?.length;\n const expandAccounts = diffCount ? 'remote' : 'local';\n\n // If there's a status and filter action is 'hide', then the notification is hidden\n // TODO: Handle 'warn' action one day\n if (!!status?.filtered) {\n const isOwnPost = status?.account?.id === currentAccount;\n const filterInfo = isFiltered(status.filtered, 'notifications');\n if (!isSelf && !isOwnPost && filterInfo?.action === 'hide') {\n return null;\n }\n }\n\n return (\n <div\n class={`notification notification-${type}`}\n data-notification-id={_ids || id}\n data-group-key={_groupKeys?.join(' ') || groupKey}\n tabIndex=\"0\"\n >\n <div\n class={`notification-type notification-${type}`}\n title={formattedCreatedAt}\n >\n {type === 'favourite+reblog' ? (\n <>\n <Icon icon=\"rocket\" size=\"xl\" alt={type} class=\"reblog-icon\" />\n <Icon icon=\"heart\" size=\"xl\" alt={type} class=\"favourite-icon\" />\n </>\n ) : (\n <Icon\n icon={NOTIFICATION_ICONS[type] || 'notification'}\n size=\"xl\"\n alt={type}\n />\n )}\n </div>\n <div class=\"notification-content\">\n {type !== 'mention' && (\n <>\n <p>{text}</p>\n {type === 'follow_request' && (\n <FollowRequestButtons accountID={account.id} />\n )}\n {type === 'severed_relationships' && (\n <div>\n {SEVERED_RELATIONSHIPS_TEXT[event.type]({\n from: instance,\n ...event,\n })}\n <br />\n <a\n href={`https://${instance}/severed_relationships`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n .\n </div>\n )}\n {type === 'moderation_warning' && !!moderation_warning && (\n <div>\n {_(MODERATION_WARNING_TEXT[moderation_warning.action]())}\n <br />\n <a\n href={`/disputes/strikes/${moderation_warning.id}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n </div>\n )}\n </>\n )}\n {_accounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {_accounts.slice(0, AVATARS_LIMIT).map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size={\n _accounts.length <= 10\n ? 'xxl'\n : _accounts.length < 20\n ? 'xl'\n : 'l'\n }\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n </a>{' '}\n </Fragment>\n ))}\n {type === 'favourite+reblog' && expandAccounts === 'remote' ? (\n <button\n type=\"button\"\n class=\"small plain\"\n data-group-keys={_groupKeys?.join(' ')}\n onClick={() => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n fetchAccounts: async () => {\n const keyAccounts = await Promise.allSettled(\n _groupKeys.map(async (gKey) => {\n const iterator = masto.v2.notifications\n .$select(gKey)\n .accounts.list();\n return [gKey, (await iterator.next()).value];\n }),\n );\n const accounts = [];\n for (const keyAccount of keyAccounts) {\n const [key, _accounts] = keyAccount.value;\n const type = /^favourite/.test(key)\n ? 'favourite'\n : /^reblog/.test(key)\n ? 'reblog'\n : null;\n if (!type) continue;\n for (const account of _accounts) {\n const theAccount = accounts.find(\n (a) => a.id === account.id,\n );\n if (theAccount) {\n theAccount._types.push(type);\n } else {\n account._types = [type];\n accounts.push(account);\n }\n }\n }\n return {\n done: true,\n value: accounts,\n };\n },\n showReactions: true,\n postID: statusKey(actualStatusID, instance),\n };\n }}\n >\n <Icon icon=\"chevron-down\" />\n </button>\n ) : (\n <button\n type=\"button\"\n class=\"small plain\"\n onClick={handleOpenGenericAccounts}\n >\n {_accounts.length > AVATARS_LIMIT &&\n `+${_accounts.length - AVATARS_LIMIT}`}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </p>\n )}\n {!_accounts?.length && sampleAccounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {sampleAccounts.map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size=\"xxl\"\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {/* {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )} */}\n </a>{' '}\n </Fragment>\n ))}\n {notificationsCount > sampleAccounts.length && (\n <Link\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n class=\"button small plain centered\"\n >\n +{notificationsCount - sampleAccounts.length}\n <Icon icon=\"chevron-right\" />\n </Link>\n )}\n </p>\n )}\n {_statuses?.length > 1 && (\n <ul class=\"notification-group-statuses\">\n {_statuses.map((status) => (\n <li key={status.id}>\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n >\n <Status\n status={status}\n size=\"s\"\n previewMode\n allowContextMenu\n />\n </TruncatedLink>\n </li>\n ))}\n </ul>\n )}\n {status && (!_statuses?.length || _statuses?.length <= 1) && (\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`\n }\n onContextMenu={\n !disableContextMenu\n ? (e) => {\n const post = e.target.querySelector('.status');\n if (post) {\n // Fire a custom event to open the context menu\n if (e.metaKey) return;\n e.preventDefault();\n post.dispatchEvent(\n new MouseEvent('contextmenu', {\n clientX: e.clientX,\n clientY: e.clientY,\n }),\n );\n }\n }\n : undefined\n }\n >\n {isStatic ? (\n <Status\n status={actualStatus}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n ) : (\n <Status\n statusID={actualStatusID}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n )}\n </TruncatedLink>\n )}\n </div>\n </div>\n );\n}\n\nfunction TruncatedLink(props) {\n const ref = useTruncated();\n return <Link {...props} data-read-more={t`Read more →`} ref={ref} />;\n}\n\nexport default memo(Notification, (oldProps, newProps) => {\n return oldProps.notification?.id === newProps.notification?.id;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport {\n getAccountByAccessToken,\n getCurrentAccount,\n} from '../utils/store-utils';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Modal from './modal';\nimport Notification from './notification';\n\n{\n if ('serviceWorker' in navigator) {\n console.log('👂👂👂 Listen to message');\n navigator.serviceWorker.addEventListener('message', (event) => {\n console.log('💥💥💥 Message event', event);\n const { type, id, accessToken } = event?.data || {};\n if (type === 'notification') {\n states.routeNotification = {\n id,\n accessToken,\n };\n }\n });\n }\n}\n\nexport default memo(function NotificationService() {\n if (!('serviceWorker' in navigator)) return null;\n\n const snapStates = useSnapshot(states);\n const { routeNotification } = snapStates;\n\n console.log('🛎️ Notification service', routeNotification);\n\n const { id, accessToken } = routeNotification || {};\n const [showNotificationSheet, setShowNotificationSheet] = useState(false);\n\n useLayoutEffect(() => {\n if (!id || !accessToken) return;\n const { instance: currentInstance } = api();\n const { masto, instance } = api({\n accessToken,\n });\n console.log('API', { accessToken, currentInstance, instance });\n const sameInstance = currentInstance === instance;\n const account = accessToken\n ? getAccountByAccessToken(accessToken)\n : getCurrentAccount();\n (async () => {\n const notification = await masto.v1.notifications.$select(id).fetch();\n if (notification && account) {\n console.log('🛎️ Notification', { id, notification, account });\n const accountInstance = account.instanceURL;\n const { type, status, account: notificationAccount } = notification;\n const hasModal = !!document.querySelector('#modal-container > *');\n const isFollow = type === 'follow' && !!notificationAccount?.id;\n const hasAccount = !!notificationAccount?.id;\n const hasStatus = !!status?.id;\n if (isFollow && sameInstance) {\n // Show account sheet, can handle different instances\n states.showAccount = {\n account: notificationAccount,\n instance: accountInstance,\n };\n } else if (hasModal || !sameInstance || (hasAccount && hasStatus)) {\n // Show sheet of notification, if\n // - there is a modal open\n // - the notification is from another instance\n // - the notification has both account and status, gives choice for users to go to account or status\n setShowNotificationSheet({\n id,\n account,\n notification,\n sameInstance,\n });\n } else {\n if (hasStatus) {\n // Go to status page\n location.hash = `/${currentInstance}/s/${status.id}`;\n } else if (isFollow) {\n // Go to profile page\n location.hash = `/${currentInstance}/a/${notificationAccount.id}`;\n } else {\n // Go to notifications page\n location.hash = '/notifications';\n }\n }\n } else {\n console.warn('🛎️ Notification not found', id);\n }\n })();\n }, [id, accessToken]);\n\n // useLayoutEffect(() => {\n // // Listen to message from service worker\n // const handleMessage = (event) => {\n // console.log('💥💥💥 Message event', event);\n // const { type, id, accessToken } = event?.data || {};\n // if (type === 'notification') {\n // states.routeNotification = {\n // id,\n // accessToken,\n // };\n // }\n // };\n // console.log('👂👂👂 Listen to message');\n // navigator.serviceWorker.addEventListener('message', handleMessage);\n // return () => {\n // console.log('👂👂👂 Remove listen to message');\n // navigator.serviceWorker.removeEventListener('message', handleMessage);\n // };\n // }, []);\n\n useLayoutEffect(() => {\n if (navigator?.clearAppBadge) {\n navigator.clearAppBadge();\n }\n }, []);\n usePageVisibility((visible) => {\n if (visible && navigator?.clearAppBadge) {\n console.log('🔰 Clear app badge');\n navigator.clearAppBadge();\n }\n });\n\n const onClose = () => {\n setShowNotificationSheet(false);\n states.routeNotification = null;\n\n // If url is #/notifications?id=123, go to #/notifications\n if (/\\/notifications\\?id=/i.test(location.hash)) {\n location.hash = '/notifications';\n }\n };\n\n if (showNotificationSheet) {\n const { id, account, notification, sameInstance } = showNotificationSheet;\n return (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>Notification</Trans>\n </b>\n </header>\n <main>\n {!sameInstance && (\n <p>\n <Trans>This notification is from your other account.</Trans>\n </p>\n )}\n <div\n class=\"notification-peek\"\n // style={{\n // pointerEvents: sameInstance ? '' : 'none',\n // }}\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (e.target.tagName === 'BUTTON' || e.target.tagName === 'A') {\n onClose();\n }\n }}\n >\n <Notification\n instance={account.instanceURL}\n notification={notification}\n isStatic\n />\n </div>\n <div\n style={{\n textAlign: 'end',\n }}\n >\n <Link to=\"/notifications\" class=\"button light\" onClick={onClose}>\n <span>\n <Trans>View all notifications</Trans>\n </span>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n </main>\n </div>\n </Modal>\n );\n }\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst SearchForm = forwardRef((props, ref) => {\n const { instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const [searchMenuOpen, setSearchMenuOpen] = useState(false);\n const [query, setQuery] = useState(searchParams.get('q') || '');\n const type = searchParams.get('type');\n const formRef = useRef(null);\n\n const searchFieldRef = useRef(null);\n useImperativeHandle(ref, () => ({\n setValue: (value) => {\n setQuery(value);\n },\n focus: () => {\n searchFieldRef.current.focus();\n },\n select: () => {\n searchFieldRef.current.select();\n },\n blur: () => {\n searchFieldRef.current.blur();\n },\n }));\n\n return (\n <form\n ref={formRef}\n class=\"search-popover-container\"\n onSubmit={(e) => {\n e.preventDefault();\n\n const isSearchPage = /\\/search/.test(location.hash);\n if (isSearchPage) {\n if (query) {\n const params = {\n q: query,\n };\n if (type) params.type = type; // Preserve type\n setSearchParams(params);\n } else {\n setSearchParams({});\n }\n } else {\n if (query) {\n location.hash = `/search?q=${encodeURIComponent(query)}${\n type ? `&type=${type}` : ''\n }`;\n } else {\n location.hash = `/search`;\n }\n }\n\n props?.onSubmit?.(e);\n }}\n >\n <input\n ref={searchFieldRef}\n value={query}\n name=\"q\"\n type=\"search\"\n // autofocus\n placeholder={t`Search`}\n dir=\"auto\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck=\"false\"\n onSearch={(e) => {\n if (!e.target.value) {\n setSearchParams({});\n }\n }}\n onInput={(e) => {\n setQuery(e.target.value);\n setSearchMenuOpen(true);\n }}\n onFocus={() => {\n setSearchMenuOpen(true);\n formRef.current\n ?.querySelector('.search-popover-item')\n ?.classList.add('focus');\n }}\n onBlur={() => {\n setTimeout(() => {\n setSearchMenuOpen(false);\n }, 100);\n formRef.current\n ?.querySelector('.search-popover-item.focus')\n ?.classList.remove('focus');\n }}\n onKeyDown={(e) => {\n const { key } = e;\n switch (key) {\n case 'Escape':\n setSearchMenuOpen(false);\n break;\n case 'Down':\n case 'ArrowDown':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = formRef.current.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let nextItem = focusItem.nextElementSibling;\n while (nextItem && nextItem.hidden) {\n nextItem = nextItem.nextElementSibling;\n }\n if (nextItem) {\n nextItem.classList.add('focus');\n const siblings = Array.from(\n nextItem.parentElement.children,\n ).filter((el) => el !== nextItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const firstItem = formRef.current.querySelector(\n '.search-popover-item',\n );\n if (firstItem) {\n firstItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let prevItem = focusItem.previousElementSibling;\n while (prevItem && prevItem.hidden) {\n prevItem = prevItem.previousElementSibling;\n }\n if (prevItem) {\n prevItem.classList.add('focus');\n const siblings = Array.from(\n prevItem.parentElement.children,\n ).filter((el) => el !== prevItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const lastItem = document.querySelector(\n '.search-popover-item:last-child',\n );\n if (lastItem) {\n lastItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Enter':\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n e.preventDefault();\n focusItem.click();\n }\n setSearchMenuOpen(false);\n props?.onSubmit?.(e);\n }\n break;\n }\n }}\n />\n <div class=\"search-popover\" hidden={!searchMenuOpen || !query}>\n {/* {!!query && (\n <Link\n to={`/search?q=${encodeURIComponent(query)}`}\n class=\"search-popover-item focus\"\n onClick={(e) => {\n props?.onSubmit?.(e);\n }}\n >\n <Icon icon=\"search\" />\n <span>{query}</span>\n </Link>\n )} */}\n {!!query &&\n [\n {\n label: (\n <Trans>\n {query}{' '}\n <small class=\"insignificant\">\n accounts, hashtags &amp; posts\n </small>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}`,\n top: !type && !/\\s/.test(query),\n hidden: !!type,\n },\n {\n label: (\n <Trans>\n Posts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=statuses`,\n hidden: /^https?:/.test(query),\n top: /\\s/.test(query),\n icon: 'document',\n queryType: 'statuses',\n },\n {\n label: (\n <Trans>\n Posts tagged with <mark>#{query.replace(/^#/, '')}</mark>\n </Trans>\n ),\n to: `/${instance}/t/${query.replace(/^#/, '')}`,\n hidden:\n /^@/.test(query) || /^https?:/.test(query) || /\\s/.test(query),\n top: /^#/.test(query),\n type: 'link',\n icon: 'hashtag',\n queryType: 'hashtags',\n },\n {\n label: (\n <Trans>\n Look up <mark>{query}</mark>\n </Trans>\n ),\n to: `/${query}`,\n hidden: !/^https?:/.test(query),\n top: /^https?:/.test(query),\n type: 'link',\n },\n {\n label: (\n <Trans>\n Accounts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=accounts`,\n icon: 'group',\n queryType: 'accounts',\n },\n ]\n .sort((a, b) => {\n if (type) {\n if (a.queryType === type) return -1;\n if (b.queryType === type) return 1;\n }\n if (a.top && !b.top) return -1;\n if (!a.top && b.top) return 1;\n return 0;\n })\n .filter(({ hidden }) => !hidden)\n .map(({ label, to, icon, type }, i) => (\n <Link\n to={to}\n class={`search-popover-item ${i === 0 ? 'focus' : ''}`}\n // hidden={hidden}\n onClick={(e) => {\n console.log('onClick', e);\n props?.onSubmit?.(e);\n }}\n >\n <Icon\n icon={icon || (type === 'link' ? 'arrow-right' : 'search')}\n class=\"more-insignificant\"\n />\n <span>{label}</span>{' '}\n </Link>\n ))}\n </div>\n </form>\n );\n});\n\nexport default SearchForm;\n","import './search-command.css';\n\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport SearchForm from './search-form';\n\nexport default memo(function SearchCommand({ onClose = () => {} }) {\n const [showSearch, setShowSearch] = useState(false);\n const searchFormRef = useRef(null);\n\n useHotkeys(\n ['Slash', '/'],\n (e) => {\n setShowSearch(true);\n setTimeout(() => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n }, 0);\n },\n {\n preventDefault: true,\n ignoreEventWhen: (e) => {\n const isSearchPage = /\\/search/.test(location.hash);\n const hasModal = !!document.querySelector('#modal-container > *');\n return isSearchPage || hasModal;\n },\n },\n );\n\n const closeSearch = () => {\n setShowSearch(false);\n onClose();\n };\n\n useHotkeys(\n 'esc',\n (e) => {\n searchFormRef.current?.blur?.();\n closeSearch();\n },\n {\n enabled: showSearch,\n enableOnFormTags: true,\n preventDefault: true,\n },\n );\n\n return (\n <div\n id=\"search-command-container\"\n hidden={!showSearch}\n onClick={(e) => {\n console.log(e);\n if (e.target === e.currentTarget) {\n closeSearch();\n }\n }}\n >\n <SearchForm\n ref={searchFormRef}\n onSubmit={() => {\n closeSearch();\n }}\n />\n </div>\n );\n});\n","import './shortcuts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useNavigate } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport { SHORTCUTS_META } from '../components/shortcuts-settings';\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport states from '../utils/states';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport Link from './link';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport SubMenu2 from './submenu2';\n\nfunction Shortcuts() {\n const { _ } = useLingui();\n const { instance } = api();\n const snapStates = useSnapshot(states);\n const { shortcuts, settings } = snapStates;\n\n if (!shortcuts.length) {\n return null;\n }\n const isMultiColumnMode =\n settings.shortcutsViewMode === 'multi-column' ||\n (!settings.shortcutsViewMode && settings.shortcutsColumnsMode);\n if (isMultiColumnMode) {\n return null;\n }\n\n const menuRef = useRef();\n\n const hasLists = useRef(false);\n const formattedShortcuts = shortcuts\n .map((pin, i) => {\n const { type, ...data } = pin;\n if (!SHORTCUTS_META[type]) return null;\n let { id, path, title, subtitle, icon } = SHORTCUTS_META[type];\n\n if (typeof id === 'function') {\n id = id(data, i);\n }\n if (typeof path === 'function') {\n path = path(\n {\n ...data,\n instance: data.instance || instance,\n },\n i,\n );\n }\n if (typeof title === 'function') {\n title = title(data, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(data, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(data, i);\n }\n\n if (id === 'lists') {\n hasLists.current = true;\n }\n\n return {\n id,\n path,\n title,\n subtitle,\n icon,\n };\n })\n .filter(Boolean);\n\n const navigate = useNavigate();\n useHotkeys(\n ['1', '2', '3', '4', '5', '6', '7', '8', '9'],\n (e, handler) => {\n const index = parseInt(handler.keys[0], 10) - 1;\n if (index < formattedShortcuts.length) {\n const { path } = formattedShortcuts[index];\n if (path) {\n navigate(path);\n menuRef.current?.closeMenu?.();\n }\n }\n },\n {\n enabled: !isMultiColumnMode,\n },\n );\n\n const [lists, setLists] = useState([]);\n\n return (\n <div id=\"shortcuts\">\n {snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? (\n <nav\n class=\"tab-bar\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n >\n <ul>\n {formattedShortcuts.map(\n ({ id, path, title, subtitle, icon }, i) => {\n return (\n <li key={`${i}-${id}-${title}-${subtitle}-${path}`}>\n <Link\n class={subtitle ? 'has-subtitle' : ''}\n to={path}\n onClick={(e) => {\n if (e.target.classList.contains('is-active')) {\n e.preventDefault();\n const page = document.getElementById(`${id}-page`);\n console.log(id, page);\n if (page) {\n page.scrollTop = 0;\n const updatesButton =\n page.querySelector('.updates-button');\n if (updatesButton) {\n updatesButton.click();\n }\n }\n }\n }}\n >\n <Icon icon={icon} size=\"xl\" alt={title} />\n <span>\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n <br />\n <small>{subtitle}</small>\n </>\n )}\n </span>\n </Link>\n </li>\n );\n },\n )}\n </ul>\n </nav>\n ) : (\n <Menu2\n instanceRef={menuRef}\n overflow=\"auto\"\n viewScroll=\"close\"\n menuClassName=\"glass-menu shortcuts-menu\"\n gap={8}\n position=\"anchor\"\n onMenuChange={(e) => {\n if (e.open && hasLists.current) {\n getLists().then(setLists);\n }\n }}\n menuButton={\n <button\n type=\"button\"\n id=\"shortcuts-button\"\n class=\"plain\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n onTransitionStart={(e) => {\n // Close menu if the button disappears\n try {\n const { target } = e;\n if (getComputedStyle(target).pointerEvents === 'none') {\n menuRef.current?.closeMenu?.();\n }\n } catch (e) {}\n }}\n >\n <Icon icon=\"shortcut\" size=\"xl\" alt={t`Shortcuts`} />\n </button>\n }\n >\n {formattedShortcuts.map(({ id, path, title, subtitle, icon }, i) => {\n if (id === 'lists') {\n return (\n <SubMenu2\n menuClassName=\"glass-menu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon={icon} size=\"l\" />\n <span class=\"menu-grow\">\n <AsyncText>{title}</AsyncText>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {lists?.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </SubMenu2>\n );\n }\n\n return (\n <MenuLink\n to={path}\n key={`${i}-${id}-${title}-${subtitle}-${path}`}\n class=\"glass-menu-item\"\n >\n <Icon icon={icon} size=\"l\" />{' '}\n <span class=\"menu-grow\">\n <span>\n <AsyncText>{title}</AsyncText>\n </span>\n {subtitle && (\n <>\n {' '}\n <small class=\"more-insignificant\">{subtitle}</small>\n </>\n )}\n </span>\n <span class=\"menu-shortcut hide-until-focus-visible\">\n {i + 1}\n </span>\n </MenuLink>\n );\n })}\n </Menu2>\n )}\n </div>\n );\n}\n\nexport default memo(Shortcuts);\n","import { api } from './api';\nimport { extractTagsFromStatus, getFollowedTags } from './followed-tags';\nimport pmem from './pmem';\nimport { fetchRelationships } from './relationships';\nimport states, { saveStatus, statusKey } from './states';\nimport store from './store';\nimport supports from './supports';\n\nexport function groupBoosts(values) {\n let newValues = [];\n let boostStash = [];\n let serialBoosts = 0;\n for (let i = 0; i < values.length; i++) {\n const item = values[i];\n if (item.reblog && !item.account?.group) {\n boostStash.push(item);\n serialBoosts++;\n } else {\n newValues.push(item);\n if (serialBoosts < 3) {\n serialBoosts = 0;\n }\n }\n }\n // if boostStash is more than quarter of values\n // or if there are 3 or more boosts in a row\n if (\n values.length > 10 &&\n (boostStash.length > values.length / 4 || serialBoosts >= 3)\n ) {\n // if boostStash is more than 3 quarter of values\n const boostStashID = boostStash.map((status) => status.id);\n if (boostStash.length > (values.length * 3) / 4) {\n // insert boost array at the end of specialHome list\n newValues = [\n ...newValues,\n { id: boostStashID, items: boostStash, type: 'boosts' },\n ];\n } else {\n // insert boosts array in the middle of specialHome list\n const half = Math.floor(newValues.length / 2);\n newValues = [\n ...newValues.slice(0, half),\n {\n id: boostStashID,\n items: boostStash,\n type: 'boosts',\n },\n ...newValues.slice(half),\n ];\n }\n return newValues;\n } else {\n return values;\n }\n}\n\nexport function dedupeBoosts(items, instance) {\n const boostedStatusIDs = store.account.get('boostedStatusIDs') || {};\n const filteredItems = items.filter((item) => {\n if (!item.reblog) return true;\n const statusKey = `${instance}-${item.reblog.id}`;\n const boosterID = boostedStatusIDs[statusKey];\n if (boosterID && boosterID !== item.id) {\n console.warn(\n `🚫 Duplicate boost by ${item.account.displayName}`,\n item,\n item.reblog,\n );\n return false;\n } else {\n boostedStatusIDs[statusKey] = item.id;\n }\n return true;\n });\n // Limit to 50\n const keys = Object.keys(boostedStatusIDs);\n if (keys.length > 50) {\n keys.slice(0, keys.length - 50).forEach((key) => {\n delete boostedStatusIDs[key];\n });\n }\n store.account.set('boostedStatusIDs', boostedStatusIDs);\n return filteredItems;\n}\n\nexport function groupContext(items, instance) {\n const contexts = [];\n let contextIndex = 0;\n items.forEach((item) => {\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) return;\n if (\n contexts[i].find((t) => t.id === item.inReplyToId) ||\n contexts[i].find((t) => t.inReplyToId === item.id)\n ) {\n contexts[i].push(item);\n return;\n }\n }\n const repliedItem = items.find((i) => i.id === item.inReplyToId);\n if (repliedItem) {\n contexts[contextIndex++] = [item, repliedItem];\n }\n });\n\n // Check for cross-item contexts\n // Merge contexts into one if they have a common item (same id)\n for (let i = 0; i < contexts.length; i++) {\n for (let j = i + 1; j < contexts.length; j++) {\n const commonItem = contexts[i].find((t) => contexts[j].includes(t));\n if (commonItem) {\n contexts[i] = [...contexts[i], ...contexts[j]];\n // Remove duplicate items\n contexts[i] = contexts[i].filter(\n (item, index, self) =>\n self.findIndex((t) => t.id === item.id) === index,\n );\n contexts.splice(j, 1);\n j--;\n }\n }\n }\n\n // Sort items by checking inReplyToId\n contexts.forEach((context) => {\n context.sort((a, b) => {\n if (!a.inReplyToId && !b.inReplyToId) {\n return new Date(a.createdAt) - new Date(b.createdAt);\n }\n if (a.inReplyToId === b.id) return 1;\n if (b.inReplyToId === a.id) return -1;\n if (!a.inReplyToId) return -1;\n if (!b.inReplyToId) return 1;\n return new Date(a.createdAt) - new Date(b.createdAt);\n });\n });\n\n // Tag items that has different author than first post's author\n contexts.forEach((context) => {\n const firstItemAccountID = context[0].account.id;\n context.forEach((item) => {\n if (item.account.id !== firstItemAccountID) {\n item._differentAuthor = true;\n }\n });\n });\n\n if (contexts.length) console.log('🧵 Contexts', contexts);\n\n const newItems = [];\n const appliedContextIndices = [];\n const inReplyToIds = [];\n items.forEach((item) => {\n if (item.reblog) {\n newItems.push(item);\n return;\n }\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) {\n if (appliedContextIndices.includes(i)) return;\n const contextItems = contexts[i];\n contextItems.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return aDate - bDate;\n });\n const firstItemAccountID = contextItems[0].account.id;\n newItems.push({\n id: contextItems.map((i) => i.id),\n items: contextItems,\n type: contextItems.every((it) => it.account.id === firstItemAccountID)\n ? 'thread'\n : 'conversation',\n });\n appliedContextIndices.push(i);\n return;\n }\n }\n\n // PREPARE FOR REPLY HINTS\n if (item.inReplyToId && item.inReplyToAccountId !== item.account.id) {\n const sKey = statusKey(item.id, instance);\n if (!states.statusReply[sKey]) {\n // If it's a reply and not a thread\n inReplyToIds.push({\n sKey,\n inReplyToId: item.inReplyToId,\n });\n // queueMicrotask(async () => {\n // try {\n // const { masto } = api({ instance });\n // // const replyToStatus = await masto.v1.statuses\n // // .$select(item.inReplyToId)\n // // .fetch();\n // const replyToStatus = await fetchStatus(item.inReplyToId, masto);\n // saveStatus(replyToStatus, instance, {\n // skipThreading: true,\n // skipUnfurling: true,\n // });\n // states.statusReply[sKey] = {\n // id: replyToStatus.id,\n // instance,\n // };\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // });\n }\n }\n\n newItems.push(item);\n });\n\n // FETCH AND SHOW REPLY HINTS\n if (inReplyToIds?.length) {\n queueMicrotask(() => {\n const { masto } = api({ instance });\n console.log('REPLYHINT', inReplyToIds);\n\n // Fallback if batch fetch fails or returns nothing or not supported\n async function fallbackFetch() {\n for (let i = 0; i < inReplyToIds.length; i++) {\n const { sKey, inReplyToId } = inReplyToIds[i];\n try {\n const replyToStatus = await fetchStatus(inReplyToId, masto);\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n }\n }\n\n if (supports('@mastodon/fetch-multiple-statuses')) {\n // This is batch fetching yooo, woot\n // Limit 20, returns 422 if exceeded https://github.com/mastodon/mastodon/pull/27871\n const ids = inReplyToIds.map(({ inReplyToId }) => inReplyToId);\n (async () => {\n try {\n const replyToStatuses = await masto.v1.statuses.list({ id: ids });\n if (replyToStatuses?.length) {\n for (const replyToStatus of replyToStatuses) {\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n const sKey = inReplyToIds.find(\n ({ inReplyToId }) => inReplyToId === replyToStatus.id,\n )?.sKey;\n if (sKey) {\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n }\n }\n } else {\n fallbackFetch();\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n fallbackFetch();\n }\n })();\n } else {\n fallbackFetch();\n }\n });\n }\n\n return newItems;\n}\n\nconst fetchStatus = pmem((statusID, masto) => {\n return masto.v1.statuses.$select(statusID).fetch();\n});\n\nexport async function assignFollowedTags(items, instance) {\n const followedTags = await getFollowedTags(); // [{name: 'tag'}, {...}]\n if (!followedTags.length) return;\n const { statusFollowedTags } = states;\n console.log('statusFollowedTags', statusFollowedTags);\n const statusWithFollowedTags = [];\n items.forEach((item) => {\n if (item.reblog) return;\n const { id, content, tags = [] } = item;\n const sKey = statusKey(id, instance);\n if (statusFollowedTags[sKey]?.length) return;\n const extractedTags = extractTagsFromStatus(content);\n if (!extractedTags.length && !tags.length) return;\n const itemFollowedTags = followedTags.reduce((acc, tag) => {\n if (\n extractedTags.some((t) => t.toLowerCase() === tag.name.toLowerCase()) ||\n tags.some((t) => t.name.toLowerCase() === tag.name.toLowerCase())\n ) {\n acc.push(tag.name);\n }\n return acc;\n }, []);\n if (itemFollowedTags.length) {\n // statusFollowedTags[sKey] = itemFollowedTags;\n statusWithFollowedTags.push({\n item,\n sKey,\n followedTags: itemFollowedTags,\n });\n }\n });\n\n if (statusWithFollowedTags.length) {\n const accounts = statusWithFollowedTags.map((s) => s.item.account);\n const relationships = await fetchRelationships(accounts);\n if (!relationships) return;\n\n statusWithFollowedTags.forEach((s) => {\n const { item, sKey, followedTags } = s;\n const r = relationships[item.account.id];\n if (r && !r.following) {\n statusFollowedTags[sKey] = followedTags;\n }\n });\n }\n}\n\nexport function clearFollowedTagsState() {\n states.statusFollowedTags = {};\n}\n","import { useLayoutEffect, useState } from 'preact/hooks';\n\nexport default function useScroll({\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n} = {}) {\n const [scrollDirection, setScrollDirection] = useState(null);\n const [reachStart, setReachStart] = useState(false);\n const [reachEnd, setReachEnd] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n let previousScrollStart = isVertical\n ? scrollableElement.scrollTop\n : scrollableElement.scrollLeft;\n\n function onScroll() {\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n setScrollDirection(previousScrollStart < scrollStart ? 'end' : 'start');\n previousScrollStart = scrollStart;\n }\n\n setReachStart(scrollStart <= 0);\n setReachEnd(scrollStart + clientDimension >= scrollDimension);\n setNearReachStart(scrollStart <= distanceFromStartPx);\n setNearReachEnd(\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n );\n }\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ]);\n\n return {\n scrollDirection,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n init: () => {\n if (scrollableRef.current) {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n }\n },\n };\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\n\nexport default function useScrollFn(\n {\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n init,\n } = {},\n callback,\n deps,\n) {\n if (!callback) return;\n // const [scrollDirection, setScrollDirection] = useState(null);\n // const [reachStart, setReachStart] = useState(false);\n // const [reachEnd, setReachEnd] = useState(false);\n // const [nearReachStart, setNearReachStart] = useState(false);\n // const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n const previousScrollStart = useRef(null);\n const scrollDirection = useRef(null);\n\n const onScroll = useThrottledCallback(() => {\n // let scrollDirection = null;\n let reachStart = false;\n let reachEnd = false;\n let nearReachStart = false;\n let nearReachEnd = false;\n\n const scrollableElement = scrollableRef.current;\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart.current);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart.current < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n // setScrollDirection(\n // previousScrollStart.current < scrollStart ? 'end' : 'start',\n // );\n scrollDirection.current =\n previousScrollStart.current < scrollStart ? 'end' : 'start';\n previousScrollStart.current = scrollStart;\n }\n\n // setReachStart(scrollStart <= 0);\n // setReachEnd(scrollStart + clientDimension >= scrollDimension);\n // setNearReachStart(scrollStart <= distanceFromStartPx);\n // setNearReachEnd(\n // scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n // );\n reachStart = scrollStart <= 0;\n reachEnd = scrollStart + clientDimension >= scrollDimension;\n nearReachStart = scrollStart <= distanceFromStartPx;\n nearReachEnd =\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx;\n\n callback({\n scrollDirection: scrollDirection.current,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n });\n }, 500);\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n previousScrollStart.current =\n scrollableElement[isVertical ? 'scrollTop' : 'scrollLeft'];\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ...deps,\n ]);\n\n // useEffect(() => {\n // callback({\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // });\n // }, [\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // ...deps,\n // ]);\n\n useEffect(() => {\n if (init && scrollableRef.current) {\n queueMicrotask(() => {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n });\n }\n }, [init]);\n\n // return {\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // init: () => {\n // if (scrollableRef.current) {\n // scrollableRef.current.dispatchEvent(new Event('scroll'));\n // }\n // },\n // };\n}\n","import './media-post.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport states, { statusKey } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport Media from './media';\n\nfunction MediaPost({\n class: className,\n statusID,\n status,\n instance,\n parent,\n // allowFilters,\n onMediaClick,\n}) {\n let sKey = statusKey(statusID, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments,\n reblog,\n uri,\n url,\n emojis,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n } = status;\n\n if (!mediaAttachments?.length) {\n return null;\n }\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo = !isSelf && isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Media post', id, status?.account.displayName);\n\n const hasSpoiler = sensitive;\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n const prefs = store.account.get('preferences') || {};\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n const showSpoilerMedia = readingExpandMedia === 'show_all';\n\n const Parent = parent || 'div';\n\n return mediaAttachments.map((media, i) => {\n const mediaKey = `${sKey}-${media.id}`;\n const filterTitleStr = filterInfo?.titlesStr;\n return (\n <Parent\n data-state-post-id={sKey}\n onMouseEnter={debugHover}\n key={mediaKey}\n data-spoiler-text={\n spoilerText || (sensitive ? t`Sensitive media` : undefined)\n }\n data-filtered-text={\n filterInfo\n ? filterTitleStr\n ? t`Filtered: ${filterTitleStr}`\n : t`Filtered`\n : undefined\n }\n class={`\n media-post\n ${filterInfo ? 'filtered' : ''}\n ${hasSpoiler ? 'has-spoiler' : ''}\n ${showSpoilerMedia ? 'show-media' : ''}\n `}\n >\n <Media\n class={className}\n media={media}\n lang={language}\n to={`/${instance}/s/${id}?media-only=${i + 1}`}\n onClick={\n onMediaClick ? (e) => onMediaClick(e, i, media, status) : undefined\n }\n />\n </Parent>\n );\n });\n}\n\nexport default memo(MediaPost);\n","import './nav-menu.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { ControlledMenu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport MenuLink from './menu-link';\nimport SubMenu2 from './submenu2';\n\nfunction NavMenu(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance, authenticated } = api();\n\n const [currentAccount, moreThanOneAccount] = useMemo(() => {\n const accounts = store.local.getJSON('accounts') || [];\n const acc =\n accounts.find((account) => account.info.id === getCurrentAccountID()) ||\n accounts[0];\n return [acc, accounts.length > 1];\n }, []);\n\n // Home = Following\n // But when in multi-column mode, Home becomes columns of anything\n // User may choose pin or not to pin Following\n // If user doesn't pin Following, we show it in the menu\n const showFollowing =\n (snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !snapStates.shortcuts.find((pin) => pin.type === 'following');\n\n const bindLongPress = useLongPress(\n () => {\n states.showAccounts = true;\n },\n {\n threshold: 600,\n detect: 'touch',\n cancelOnMovement: true,\n },\n );\n\n const buttonRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n\n const boundingBoxPadding = safeBoundingBoxPadding([\n 0,\n 0,\n snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? 50 : 0,\n 0,\n ]);\n\n const mutesIterator = useRef();\n async function fetchMutes(firstLoad) {\n if (firstLoad || !mutesIterator.current) {\n mutesIterator.current = masto.v1.mutes.list({\n limit: 80,\n });\n }\n const results = await mutesIterator.current.next();\n return results;\n }\n\n const blocksIterator = useRef();\n async function fetchBlocks(firstLoad) {\n if (firstLoad || !blocksIterator.current) {\n blocksIterator.current = masto.v1.blocks.list({\n limit: 80,\n });\n }\n const results = await blocksIterator.current.next();\n return results;\n }\n\n const supportsLists = supports('@mastodon/lists');\n const [lists, setLists] = useState([]);\n useEffect(() => {\n if (!supportsLists) return;\n if (menuState === 'open') {\n getLists().then(setLists);\n }\n }, [menuState === 'open']);\n\n const buttonClickTS = useRef();\n return (\n <>\n <button\n ref={buttonRef}\n type=\"button\"\n class={`button plain nav-menu-button ${\n moreThanOneAccount ? 'with-avatar' : ''\n } ${menuState === 'open' ? 'active' : ''}`}\n style={{ position: 'relative' }}\n onClick={() => {\n buttonClickTS.current = Date.now();\n setMenuState((state) => (!state ? 'open' : undefined));\n }}\n onContextMenu={(e) => {\n e.preventDefault();\n states.showAccounts = true;\n }}\n {...bindLongPress()}\n >\n {moreThanOneAccount && (\n <Avatar\n url={\n currentAccount?.info?.avatar || currentAccount?.info?.avatarStatic\n }\n size=\"l\"\n squircle={currentAccount?.info?.bot}\n />\n )}\n <Icon icon=\"menu\" size={moreThanOneAccount ? 's' : 'l'} alt={t`Menu`} />\n </button>\n <ControlledMenu\n menuClassName=\"nav-menu\"\n state={menuState}\n anchorRef={buttonRef}\n onClose={() => {\n setMenuState(undefined);\n }}\n containerProps={{\n style: {\n zIndex: 10,\n },\n onClick: () => {\n if (Date.now() - buttonClickTS.current < 300) {\n return;\n }\n // setMenuState(undefined);\n },\n }}\n portal={{\n target: document.body,\n }}\n {...props}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding={boundingBoxPadding}\n unmountOnClose\n >\n {!!snapStates.appVersion?.commitHash &&\n __COMMIT_HASH__ !== snapStates.appVersion.commitHash && (\n <div class=\"top-menu\">\n <MenuItem\n onClick={() => {\n const yes = confirm(t`Reload page now to update?`);\n if (yes) {\n (async () => {\n try {\n location.reload();\n } catch (e) {}\n })();\n }\n }}\n >\n <Icon icon=\"sparkles\" class=\"sparkle-icon\" size=\"l\" />{' '}\n <span>\n <Trans>New update available…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </div>\n )}\n <section>\n <MenuLink to=\"/\">\n <Icon icon=\"home\" size=\"l\" />{' '}\n <span>\n <Trans>Home</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n {showFollowing && (\n <MenuLink to=\"/following\">\n <Icon icon=\"following\" size=\"l\" />{' '}\n <span>\n <Trans id=\"following.title\">Following</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/catchup\">\n <Icon icon=\"history2\" size=\"l\" />\n <span>\n <Trans>Catch-up</Trans>\n </span>\n </MenuLink>\n {supports('@mastodon/mentions') && (\n <MenuLink to=\"/mentions\">\n <Icon icon=\"at\" size=\"l\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/notifications\">\n <Icon icon=\"notification\" size=\"l\" />{' '}\n <span>\n <Trans>Notifications</Trans>\n </span>\n {snapStates.notificationsShowNew && (\n <sup title={t`New`} style={{ opacity: 0.5 }}>\n {' '}\n &bull;\n </sup>\n )}\n </MenuLink>\n <MenuDivider />\n {currentAccount?.info?.id && (\n <MenuLink to={`/${instance}/a/${currentAccount.info.id}`}>\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Profile</Trans>\n </span>\n </MenuLink>\n )}\n {lists?.length > 0 ? (\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"list\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>Lists</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </SubMenu2>\n ) : (\n supportsLists && (\n <MenuLink to=\"/l\">\n <Icon icon=\"list\" size=\"l\" />\n <span>\n <Trans>Lists</Trans>\n </span>\n </MenuLink>\n )\n )}\n <MenuLink to=\"/b\">\n <Icon icon=\"bookmark\" size=\"l\" />{' '}\n <span>\n <Trans>Bookmarks</Trans>\n </span>\n </MenuLink>\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"more\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>More…</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/f\">\n <Icon icon=\"heart\" size=\"l\" />{' '}\n <span>\n <Trans>Likes</Trans>\n </span>\n </MenuLink>\n <MenuLink to=\"/fh\">\n <Icon icon=\"hashtag\" size=\"l\" />{' '}\n <span>\n <Trans>Followed Hashtags</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {supports('@mastodon/filters') && (\n <MenuLink to=\"/ft\">\n <Icon icon=\"filters\" size=\"l\" />{' '}\n <span>\n <Trans>Filters</Trans>\n </span>\n </MenuLink>\n )}\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'mute',\n heading: t`Muted users`,\n fetchAccounts: fetchMutes,\n excludeRelationshipAttrs: ['muting'],\n };\n }}\n >\n <Icon icon=\"mute\" size=\"l\" />{' '}\n <span>\n <Trans>Muted users…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'block',\n heading: t`Blocked users`,\n fetchAccounts: fetchBlocks,\n excludeRelationshipAttrs: ['blocking'],\n };\n }}\n >\n <Icon icon=\"block\" size=\"l\" />{' '}\n <span>\n <Trans>Blocked users…</Trans>\n </span>\n </MenuItem>{' '}\n </SubMenu2>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showAccounts = true;\n }}\n >\n <Icon icon=\"group\" size=\"l\" />{' '}\n <span>\n <Trans>Accounts…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuLink to=\"/login\">\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Log in</Trans>\n </span>\n </MenuLink>\n </>\n )}\n </section>\n <section>\n <MenuDivider />\n <MenuLink to={`/search`}>\n <Icon icon=\"search\" size=\"l\" />{' '}\n <span>\n <Trans>Search</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/trending`}>\n <Icon icon=\"chart\" size=\"l\" />{' '}\n <span>\n <Trans>Trending</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p/l`}>\n <Icon icon=\"building\" size=\"l\" />{' '}\n <span>\n <Trans>Local</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p`}>\n <Icon icon=\"earth\" size=\"l\" />{' '}\n <span>\n <Trans>Federated</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n <MenuDivider className=\"divider-grow\" />\n <MenuItem\n onClick={() => {\n states.showKeyboardShortcutsHelp = true;\n }}\n >\n <Icon icon=\"keyboard\" size=\"l\" />{' '}\n <span>\n <Trans>Keyboard shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showShortcutsSettings = true;\n }}\n >\n <Icon icon=\"shortcut\" size=\"l\" />{' '}\n <span>\n <Trans>Shortcuts / Columns…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </section>\n </ControlledMenu>\n </>\n );\n}\n\nexport default memo(NavMenu);\n","import { plural, t, Trans } from '@lingui/macro';\nimport { memo } 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 { InView } from 'react-intersection-observer';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { filteredItems, isFiltered } from '../utils/filters';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport { groupBoosts, groupContext } from '../utils/timeline-utils';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useScrollFn from '../utils/useScrollFn';\n\nimport Icon from './icon';\nimport Link from './link';\nimport MediaPost from './media-post';\nimport NavMenu from './nav-menu';\nimport Status from './status';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Timeline({\n title,\n titleComponent,\n id,\n instance,\n emptyText,\n errorText,\n useItemID, // use statusID instead of status object, assuming it's already in states\n boostsCarousel,\n fetchItems = () => {},\n checkForUpdates = () => {},\n checkForUpdatesInterval = 15_000, // 15 seconds\n headerStart,\n headerEnd,\n timelineStart,\n // allowFilters,\n refresh,\n view,\n filterContext,\n showFollowedTags,\n showReplyParent,\n clearWhenRefresh,\n}) {\n const snapStates = useSnapshot(states);\n const [items, setItems] = useState([]);\n const [uiState, setUIState] = useState('start');\n const [showMore, setShowMore] = useState(false);\n const [showNew, setShowNew] = useState(false);\n const [visible, setVisible] = useState(true);\n const scrollableRef = useRef();\n\n console.debug('RENDER Timeline', id, refresh);\n __BENCHMARK.start(`timeline-${id}-load`);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const allowGrouping = view !== 'media';\n const loadItemsTS = useRef(0); // Ensures only one loadItems at a time\n const loadItems = useDebouncedCallback(\n (firstLoad) => {\n setShowNew(false);\n // if (uiState === 'loading') return;\n setUIState('loading');\n (async () => {\n try {\n const ts = (loadItemsTS.current = Date.now());\n let { done, value } = await fetchItems(firstLoad);\n if (ts !== loadItemsTS.current) return;\n if (Array.isArray(value)) {\n // Avoid grouping for pinned posts\n const [pinnedPosts, otherPosts] = value.reduce(\n (acc, item) => {\n if (item._pinned) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []],\n );\n value = otherPosts;\n if (allowGrouping) {\n if (boostsCarousel) {\n value = groupBoosts(value);\n }\n value = groupContext(value, instance);\n }\n if (pinnedPosts.length) {\n value = pinnedPosts.concat(value);\n }\n console.log(value);\n if (firstLoad) {\n setItems(value);\n } else {\n setItems((items) => [...items, ...value]);\n }\n if (!value.length) done = true;\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n __BENCHMARK.end(`timeline-${id}-load`);\n } catch (e) {\n console.error(e);\n setUIState('error');\n if (firstLoad && !items.length && errorText) {\n showToast(errorText);\n }\n } finally {\n loadItems.cancel();\n }\n })();\n },\n 1_000,\n {\n leading: true,\n // trailing: false,\n },\n );\n\n const itemsSelector = '.timeline-item, .timeline-item-alt';\n\n const jRef = useHotkeys('j, shift+j', (_, handler) => {\n // focus on next status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (handler.shift) {\n // get next status that's not .timeline-item-alt\n nextItem = allItems.find(\n (item, index) =>\n index > activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k, shift+k', (_, handler) => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (handler.shift) {\n // get prev status that's not .timeline-item-alt\n prevItem = allItems.findLast(\n (item, index) =>\n index < activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n // open active status\n const activeItem = document.activeElement;\n if (activeItem?.matches(itemsSelector)) {\n activeItem.click();\n }\n });\n\n const showNewPostsIndicator =\n items.length > 0 && uiState !== 'loading' && showNew;\n const handleLoadNewPosts = useCallback(() => {\n if (showNewPostsIndicator) loadItems(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [loadItems, showNewPostsIndicator]);\n const dotRef = useHotkeys('.', handleLoadNewPosts);\n\n // const {\n // scrollDirection,\n // nearReachStart,\n // nearReachEnd,\n // reachStart,\n // reachEnd,\n // } = useScroll({\n // scrollableRef,\n // distanceFromEnd: 2,\n // scrollThresholdStart: 44,\n // });\n const headerRef = useRef();\n // const [hiddenUI, setHiddenUI] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n useScrollFn(\n {\n scrollableRef,\n distanceFromEnd: 2,\n scrollThresholdStart: 44,\n },\n ({\n scrollDirection,\n nearReachStart,\n // nearReachEnd,\n reachStart,\n // reachEnd,\n }) => {\n // setHiddenUI(scrollDirection === 'end' && !nearReachEnd);\n if (headerRef.current) {\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n headerRef.current.hidden = hiddenUI;\n }\n setNearReachStart(nearReachStart);\n if (reachStart) {\n loadItems(true);\n }\n // else if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n },\n [],\n );\n\n useEffect(() => {\n scrollableRef.current?.scrollTo({ top: 0 });\n loadItems(true);\n }, []);\n const firstLoad = useRef(true);\n useEffect(() => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (clearWhenRefresh && items?.length) {\n loadItems.cancel?.();\n setItems([]);\n }\n loadItems(true);\n }, [clearWhenRefresh, refresh]);\n\n // useEffect(() => {\n // if (reachStart) {\n // loadItems(true);\n // }\n // }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n // }, [nearReachEnd, showMore]);\n\n const prevView = useRef(view);\n useEffect(() => {\n if (prevView.current !== view) {\n prevView.current = view;\n setItems([]);\n }\n }, [view]);\n\n const loadOrCheckUpdates = useCallback(\n async ({ disableIdleCheck = false } = {}) => {\n const noPointers = scrollableRef.current\n ? getComputedStyle(scrollableRef.current).pointerEvents === 'none'\n : false;\n console.log('✨ Load or check updates', id, {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current.scrollTop,\n disableIdleCheck,\n idle: window.__IDLE__,\n inBackground: inBackground(),\n noPointers,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground() &&\n !noPointers\n ) {\n console.log('✨ Load updates', id, snapStates.settings.autoRefresh);\n loadItems(true);\n } else {\n console.log('✨ Check updates', id, snapStates.settings.autoRefresh);\n const hasUpdate = await checkForUpdates();\n if (hasUpdate) {\n console.log('✨ Has new updates', id);\n setShowNew(true);\n }\n }\n },\n [id, loadItems, checkForUpdates, snapStates.settings.autoRefresh],\n );\n\n const lastHiddenTime = useRef();\n usePageVisibility(\n (visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadOrCheckUpdates({\n disableIdleCheck: true,\n });\n }\n } else {\n lastHiddenTime.current = Date.now();\n }\n setVisible(visible);\n },\n [checkForUpdates, loadOrCheckUpdates, snapStates.settings.autoRefresh],\n );\n\n // checkForUpdates interval\n useInterval(\n loadOrCheckUpdates,\n visible && !showNew\n ? checkForUpdatesInterval * (nearReachStart ? 1 : 2)\n : null,\n );\n\n // const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n\n return (\n <FilterContext.Provider value={filterContext}>\n <div\n id={`${id}-page`}\n class={`deck-container ${\n mediaFirst ? 'deck-container-media-first' : ''\n }`}\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n dotRef(node);\n }}\n tabIndex=\"-1\"\n onClick={(e) => {\n // If click on timeline item, unhide header\n if (\n headerRef.current &&\n e.target.closest('.timeline-item, .timeline-item-alt')\n ) {\n setTimeout(() => {\n headerRef.current.hidden = false;\n }, 250);\n }\n }}\n >\n <div class=\"timeline-deck deck\">\n <header\n ref={headerRef}\n // hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadItems(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {headerStart !== null && headerStart !== undefined ? (\n headerStart\n ) : (\n <Link to=\"/\" class=\"button plain home-button\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n {title && (titleComponent ? titleComponent : <h1>{title}</h1>)}\n <div class=\"header-side\">\n {/* <Loader hidden={uiState !== 'loading'} /> */}\n {!!headerEnd && headerEnd}\n </div>\n </div>\n {showNewPostsIndicator && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={handleLoadNewPosts}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New posts</Trans>\n </button>\n )}\n </header>\n {!!timelineStart && (\n <div\n class={`timeline-start ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {timelineStart}\n </div>\n )}\n {!!items.length ? (\n <>\n <ul class={`timeline ${view ? `timeline-${view}` : ''}`}>\n {items.map((status) => (\n <TimelineItem\n status={status}\n instance={instance}\n useItemID={useItemID}\n // allowFilters={allowFilters}\n filterContext={filterContext}\n key={status.id + status?._pinned + view}\n view={view}\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n mediaFirst={mediaFirst}\n />\n ))}\n {showMore &&\n uiState === 'loading' &&\n (view === 'media' ? null : (\n <>\n <li\n style={{\n height: '20vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n <li\n style={{\n height: '25vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n </>\n ))}\n </ul>\n {uiState === 'default' &&\n (showMore ? (\n <InView\n root={scrollableRef.current}\n rootMargin={`0px 0px ${screen.height * 1.5}px 0px`}\n onChange={(inView) => {\n if (inView) {\n loadItems();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadItems()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n ))}\n </>\n ) : uiState === 'loading' ? (\n <ul class=\"timeline\">\n {Array.from({ length: 5 }).map((_, i) =>\n view === 'media' ? (\n <div\n style={{\n height: '50vh',\n }}\n />\n ) : (\n <li key={i}>\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n ),\n )}\n </ul>\n ) : (\n uiState !== 'error' &&\n uiState !== 'start' && <p class=\"ui-state\">{emptyText}</p>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n {errorText}\n <br />\n <br />\n <button type=\"button\" onClick={() => loadItems(!items.length)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </div>\n </div>\n </FilterContext.Provider>\n );\n}\n\nconst TimelineItem = memo(\n ({\n status,\n instance,\n useItemID,\n // allowFilters,\n filterContext,\n view,\n showFollowedTags,\n showReplyParent,\n mediaFirst,\n }) => {\n console.debug('RENDER TimelineItem', status.id);\n const { id: statusID, reblog, items, type, _pinned } = status;\n if (_pinned) useItemID = false;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n\n if (items) {\n let fItems = filteredItems(items, filterContext);\n let title = '';\n if (type === 'boosts') {\n title = plural(fItems.length, {\n one: '# Boost',\n other: '# Boosts',\n });\n } else if (type === 'pinned') {\n title = t`Pinned posts`;\n }\n const isCarousel = type === 'boosts' || type === 'pinned';\n if (isCarousel) {\n const filteredItemsIDs = new Set();\n // Here, we don't hide filtered posts, but we sort them last\n fItems.sort((a, b) => {\n // if (a._filtered && !b._filtered) {\n // return 1;\n // }\n // if (!a._filtered && b._filtered) {\n // return -1;\n // }\n const aFiltered = isFiltered(a.filtered, filterContext);\n const bFiltered = isFiltered(b.filtered, filterContext);\n if (aFiltered) filteredItemsIDs.add(a.id);\n if (bFiltered) filteredItemsIDs.add(b.id);\n if (aFiltered && !bFiltered) {\n return 1;\n }\n if (!aFiltered && bFiltered) {\n return -1;\n }\n return 0;\n });\n\n if (filteredItemsIDs.size >= 2) {\n const GROUP_SIZE = 5;\n // If 2 or more, group filtered items into one, limit to GROUP_SIZE in a group\n const unfiltered = [];\n const filtered = [];\n fItems.forEach((item) => {\n if (filteredItemsIDs.has(item.id)) {\n filtered.push(item);\n } else {\n unfiltered.push(item);\n }\n });\n const filteredItems = [];\n for (let i = 0; i < filtered.length; i += GROUP_SIZE) {\n filteredItems.push({\n _grouped: true,\n posts: filtered.slice(i, i + GROUP_SIZE),\n });\n }\n fItems = unfiltered.concat(filteredItems);\n }\n\n return (\n <li key={`timeline-${statusID}`} class=\"timeline-item-carousel\">\n <StatusCarousel title={title} class={`${type}-carousel`}>\n {fItems.map((item) => {\n const { id: statusID, reblog, _pinned, _grouped } = item;\n if (_grouped) {\n return (\n <li key={statusID} class=\"timeline-item-carousel-group\">\n {item.posts.map((item) => {\n const { id: statusID, reblog, _pinned } = item;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n />\n )}\n </Link>\n );\n })}\n </li>\n );\n }\n\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <li key={statusID}>\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n })}\n </StatusCarousel>\n </li>\n );\n }\n const manyItems = fItems.length > 3;\n return fItems.map((item, i) => {\n const { id: statusID, _differentAuthor } = item;\n const url = instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`;\n const isMiddle = i > 0 && i < fItems.length - 1;\n const isSpoiler = item.sensitive && !!item.spoilerText;\n const showCompact =\n (!_differentAuthor && isSpoiler && i > 0) ||\n (manyItems &&\n isMiddle &&\n (type === 'thread' ||\n (type === 'conversation' &&\n !_differentAuthor &&\n !fItems[i - 1]._differentAuthor &&\n !fItems[i + 1]._differentAuthor)));\n const isStart = i === 0;\n const isEnd = i === fItems.length - 1;\n return (\n <li\n key={`timeline-${statusID}`}\n class={`timeline-item-container timeline-item-container-type-${type} timeline-item-container-${\n isStart ? 'start' : isEnd ? 'end' : 'middle'\n } ${_differentAuthor ? 'timeline-item-diff-author' : ''}`}\n >\n <Link class=\"status-link timeline-item\" to={url}>\n {showCompact ? (\n <TimelineStatusCompact\n status={item}\n instance={instance}\n filterContext={filterContext}\n />\n ) : useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n )}\n </Link>\n </li>\n );\n });\n }\n\n const itemKey = `timeline-${statusID + _pinned}`;\n\n if (view === 'media') {\n return useItemID ? (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n statusID={statusID}\n instance={instance}\n // allowFilters={allowFilters}\n />\n ) : (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n status={status}\n instance={instance}\n // allowFilters={allowFilters}\n />\n );\n }\n\n return (\n <li key={itemKey}>\n <Link class=\"status-link timeline-item\" to={url}>\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={status}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n },\n (oldProps, newProps) => {\n const oldID = (oldProps.status?.id || '').toString();\n const newID = (newProps.status?.id || '').toString();\n return (\n oldID === newID &&\n oldProps.instance === newProps.instance &&\n oldProps.view === newProps.view\n );\n },\n);\n\nfunction StatusCarousel({ title, class: className, children }) {\n const carouselRef = useRef();\n // const { reachStart, reachEnd, init } = useScroll({\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // });\n const startButtonRef = useRef();\n const endButtonRef = useRef();\n // useScrollFn(\n // {\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // init: true,\n // },\n // ({ reachStart, reachEnd }) => {\n // if (startButtonRef.current) startButtonRef.current.disabled = reachStart;\n // if (endButtonRef.current) endButtonRef.current.disabled = reachEnd;\n // },\n // [],\n // );\n // useEffect(() => {\n // init?.();\n // }, []);\n\n const [render, setRender] = useState(false);\n useEffect(() => {\n setTimeout(() => {\n setRender(true);\n }, 1);\n }, []);\n\n return (\n <div class={`status-carousel ${className}`}>\n <header>\n <h3>{title}</h3>\n <span>\n <button\n ref={startButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachStart}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? 1 : -1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-left\" alt={t`Previous`} />\n </button>{' '}\n <button\n ref={endButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachEnd}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? -1 : 1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-right\" alt={t`Next`} />\n </button>\n </span>\n </header>\n <ul ref={carouselRef}>\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (startButtonRef.current)\n startButtonRef.current.disabled = inView;\n }}\n />\n {children[0]}\n {render && children.slice(1)}\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (endButtonRef.current) endButtonRef.current.disabled = inView;\n }}\n />\n </ul>\n </div>\n );\n}\n\nfunction TimelineStatusCompact({ status, instance, filterContext }) {\n const snapStates = useSnapshot(states);\n const { id, visibility, language } = status;\n const statusPeekText = statusPeek(status);\n const sKey = statusKey(id, instance);\n const filterInfo = isFiltered(status.filtered, filterContext);\n return (\n <article\n class={`status compact-thread ${\n visibility === 'direct' ? 'visibility-direct' : ''\n }`}\n tabindex=\"-1\"\n >\n {!!snapStates.statusThreadNumber[sKey] ? (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n </div>\n ) : (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n </div>\n )}\n <div\n class=\"content-compact\"\n title={statusPeekText}\n lang={language}\n dir=\"auto\"\n >\n {!!filterInfo ? (\n <b\n class=\"status-filtered-badge badge-meta horizontal\"\n title={filterInfo?.titlesStr || ''}\n >\n {filterInfo?.titlesStr ? (\n <Trans>\n <span>Filtered</span>: <span>{filterInfo.titlesStr}</span>\n </Trans>\n ) : (\n <span>\n <Trans>Filtered</Trans>\n </span>\n )}\n </b>\n ) : (\n <>\n {statusPeekText}\n {status.sensitive && status.spoilerText && (\n <>\n {' '}\n <span class=\"spoiler-badge\">\n <Icon icon=\"eye-close\" size=\"s\" alt={t`Content warning`} />\n </span>\n </>\n )}\n </>\n )}\n </div>\n </article>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nexport default Timeline;\n","import { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountInfo from '../components/account-info';\nimport EmojiText from '../components/emoji-text';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst MIN_YEAR = 1983;\nconst MIN_YEAR_MONTH = `${MIN_YEAR}-01`; // Birth of the Internet\n\nconst supportsInputMonth = (() => {\n try {\n const input = document.createElement('input');\n input.setAttribute('type', 'month');\n return input.type === 'month';\n } catch (e) {\n return false;\n }\n})();\n\nasync function _isSearchEnabled(instance) {\n const { masto } = api({ instance });\n const results = await masto.v2.search.fetch({\n q: 'from:me',\n type: 'statuses',\n limit: 1,\n });\n return !!results?.statuses?.length;\n}\nconst isSearchEnabled = pmem(_isSearchEnabled);\n\nfunction AccountStatuses() {\n const snapStates = useSnapshot(states);\n const { id, ...params } = useParams();\n const [searchParams, setSearchParams] = useSearchParams();\n const month = searchParams.get('month');\n const excludeReplies = !searchParams.get('replies');\n const excludeBoosts = !!searchParams.get('boosts');\n const tagged = searchParams.get('tagged');\n const media = !!searchParams.get('media');\n const { masto, instance, authenticated } = api({ instance: params.instance });\n const { masto: currentMasto, instance: currentInstance } = api();\n const accountStatusesIterator = useRef();\n\n const allSearchParams = [month, excludeReplies, excludeBoosts, tagged, media];\n const [account, setAccount] = useState();\n const searchOffsetRef = useRef(0);\n useEffect(() => {\n searchOffsetRef.current = 0;\n }, allSearchParams);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n const [searchEnabled, setSearchEnabled] = useState(false);\n useEffect(() => {\n // Only enable for current logged-in instance\n // Most remote instances don't allow unauthenticated searches\n if (!sameCurrentInstance) return;\n if (!account?.acct) return;\n (async () => {\n const enabled = await isSearchEnabled(instance);\n console.log({ enabled });\n setSearchEnabled(enabled);\n })();\n }, [instance, sameCurrentInstance, account?.acct]);\n\n async function fetchAccountStatuses(firstLoad) {\n const isValidMonth = /^\\d{4}-[01]\\d$/.test(month);\n const isValidYear = month?.split?.('-')?.[0] >= MIN_YEAR;\n if (isValidMonth && isValidYear) {\n if (!account) {\n return {\n value: [],\n done: true,\n };\n }\n const [_year, _month] = month.split('-');\n const monthIndex = parseInt(_month, 10) - 1;\n // YYYY-MM (no day)\n // Search options:\n // - from:account\n // - after:YYYY-MM-DD (non-inclusive)\n // - before:YYYY-MM-DD (non-inclusive)\n\n // Last day of previous month\n const after = new Date(_year, monthIndex, 0);\n const afterStr = `${after.getFullYear()}-${(after.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${after.getDate().toString().padStart(2, '0')}`;\n // First day of next month\n const before = new Date(_year, monthIndex + 1, 1);\n const beforeStr = `${before.getFullYear()}-${(before.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${before.getDate().toString().padStart(2, '0')}`;\n console.log({\n month,\n _year,\n _month,\n monthIndex,\n after,\n before,\n afterStr,\n beforeStr,\n });\n\n let limit;\n if (firstLoad) {\n limit = LIMIT + 1;\n searchOffsetRef.current = 0;\n } else {\n limit = LIMIT + searchOffsetRef.current + 1;\n searchOffsetRef.current += LIMIT;\n }\n\n const searchResults = await masto.v2.search.fetch({\n q: `from:${account.acct} after:${afterStr} before:${beforeStr}`,\n type: 'statuses',\n limit,\n offset: searchOffsetRef.current,\n });\n if (searchResults?.statuses?.length) {\n const value = searchResults.statuses.slice(0, LIMIT);\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n const done = searchResults.statuses.length <= LIMIT;\n return { value, done };\n } else {\n return { value: [], done: true };\n }\n }\n\n let results = [];\n if (firstLoad) {\n const { value } = await masto.v1.accounts\n .$select(id)\n .statuses.list({\n pinned: true,\n })\n .next();\n if (value?.length && !tagged && !media) {\n const pinnedStatuses = value.map((status) => {\n saveStatus(status, instance);\n return {\n ...status,\n _pinned: true,\n };\n });\n if (pinnedStatuses.length >= 3) {\n const pinnedStatusesIds = pinnedStatuses.map((status) => status.id);\n results.push({\n id: pinnedStatusesIds,\n items: pinnedStatuses,\n type: 'pinned',\n });\n } else {\n results.push(...pinnedStatuses);\n }\n }\n }\n if (firstLoad || !accountStatusesIterator.current) {\n accountStatusesIterator.current = masto.v1.accounts\n .$select(id)\n .statuses.list({\n limit: LIMIT,\n exclude_replies: excludeReplies,\n exclude_reblogs: excludeBoosts,\n only_media: media || undefined,\n tagged,\n });\n }\n const { value, done } = await accountStatusesIterator.current.next();\n if (value?.length) {\n // Check if value is same as pinned post (results)\n // If the index for every post is the same, means API might not support pinned posts\n if (results.length) {\n let pinnedStatusesIds = [];\n if (results[0]?.type === 'pinned') {\n pinnedStatusesIds = results[0].id;\n } else {\n pinnedStatusesIds = results\n .filter((status) => status._pinned)\n .map((status) => status.id);\n }\n const containsAllPinned = pinnedStatusesIds.every((postId) =>\n value.some((status) => status.id === postId),\n );\n if (containsAllPinned) {\n // Remove pinned posts\n results = [];\n }\n }\n\n results.push(...value);\n\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n value: results,\n done,\n };\n }\n\n const [featuredTags, setFeaturedTags] = useState([]);\n const { i18n } = useLingui();\n let title = t`Account posts`;\n if (account?.acct) {\n const acctDisplay = (/@/.test(account.acct) ? '' : '@') + account.acct;\n const accountDisplay = account?.displayName\n ? `${account.displayName} (${acctDisplay})`\n : `${acctDisplay}`;\n if (!excludeReplies) {\n title = t`${accountDisplay} (+ Replies)`;\n } else if (excludeBoosts) {\n title = t`${accountDisplay} (- Boosts)`;\n } else if (tagged) {\n title = t`${accountDisplay} (#${tagged})`;\n } else if (media) {\n title = t`${accountDisplay} (Media)`;\n } else if (month) {\n const monthYear = new Date(month).toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n });\n title = t`${accountDisplay} (${monthYear})`;\n } else {\n title = accountDisplay;\n }\n }\n useTitle(title, '/:instance?/a/:id');\n\n const fetchAccountPromiseRef = useRef();\n const fetchAccount = useCallback(() => {\n const fetchPromise =\n fetchAccountPromiseRef.current || masto.v1.accounts.$select(id).fetch();\n fetchAccountPromiseRef.current = fetchPromise;\n return fetchPromise;\n }, [id, masto]);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await fetchAccount();\n console.log(acc);\n setAccount(acc);\n } catch (e) {\n console.error(e);\n }\n // No need, because the whole filter bar is hidden\n // TODO: Revisit this\n if (!mediaFirst) {\n try {\n const featuredTags = await masto.v1.accounts\n .$select(id)\n .featuredTags.list();\n console.log({ featuredTags });\n setFeaturedTags(featuredTags);\n } catch (e) {\n console.error(e);\n }\n }\n })();\n }, [id, mediaFirst]);\n\n const { displayName, acct, emojis } = account || {};\n\n const filterBarRef = useRef();\n const TimelineStart = useMemo(() => {\n const filtered =\n !excludeReplies || excludeBoosts || tagged || media || !!month;\n const cachedAccount = snapStates.accounts[`${id}@${instance}`];\n\n return (\n <>\n <AccountInfo\n instance={instance}\n account={cachedAccount || id}\n fetchAccount={fetchAccount}\n authenticated={authenticated}\n standalone\n />\n {!mediaFirst && (\n <div\n class=\"filter-bar\"\n ref={filterBarRef}\n style={{\n position: 'relative',\n }}\n >\n {filtered ? (\n <Link\n to={`/${instance}/a/${id}`}\n class=\"insignificant filter-clear\"\n title={t`Clear filters`}\n key=\"clear-filters\"\n >\n <Icon icon=\"x\" size=\"l\" alt={t`Clear`} />\n </Link>\n ) : (\n <Icon\n icon=\"filter\"\n class=\"insignificant\"\n size=\"l\"\n alt={t`Filters`}\n />\n )}\n <Link\n to={`/${instance}/a/${id}${excludeReplies ? '?replies=1' : ''}`}\n onClick={() => {\n if (excludeReplies) {\n showToast(t`Showing post with replies`);\n }\n }}\n class={excludeReplies ? '' : 'is-active'}\n >\n <Trans>+ Replies</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${excludeBoosts ? '' : '?boosts=0'}`}\n onClick={() => {\n if (!excludeBoosts) {\n showToast(t`Showing posts without boosts`);\n }\n }}\n class={!excludeBoosts ? '' : 'is-active'}\n >\n <Trans>- Boosts</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${media ? '' : '?media=1'}`}\n onClick={() => {\n if (!media) {\n showToast(t`Showing posts with media`);\n }\n }}\n class={media ? 'is-active' : ''}\n >\n <Trans>Media</Trans>\n </Link>\n {featuredTags.map((tag) => (\n <Link\n key={tag.id}\n to={`/${instance}/a/${id}${\n tagged === tag.name\n ? ''\n : `?tagged=${encodeURIComponent(tag.name)}`\n }`}\n onClick={() => {\n if (tagged !== tag.name) {\n showToast(t`Showing posts tagged with #${tag.name}`);\n }\n }}\n class={tagged === tag.name ? 'is-active' : ''}\n >\n <span>\n <span class=\"more-insignificant\">#</span>\n {tag.name}\n </span>\n {\n // The count differs based on instance 😅\n }\n {/* <span class=\"filter-count\">{tag.statusesCount}</span> */}\n </Link>\n ))}\n {searchEnabled &&\n (supportsInputMonth ? (\n <label class={`filter-field ${month ? 'is-active' : ''}`}>\n <Icon icon=\"month\" size=\"l\" />\n <input\n type=\"month\"\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e.currentTarget;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n const [year, month] = value.split('-');\n const monthIndex = parseInt(month, 10) - 1;\n const date = new Date(year, monthIndex);\n showToast(\n t`Showing posts in ${date.toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n })}`,\n );\n }}\n />\n </label>\n ) : (\n // Fallback to <select> for month and <input type=\"number\"> for year\n <MonthPicker\n class={`filter-field ${month ? 'is-active' : ''}`}\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n }}\n />\n ))}\n </div>\n )}\n </>\n );\n }, [\n id,\n instance,\n authenticated,\n featuredTags,\n fetchAccount,\n searchEnabled,\n ...allSearchParams,\n ]);\n\n useEffect(() => {\n // Focus on .is-active\n const active = filterBarRef.current?.querySelector('.is-active');\n if (active) {\n console.log('active', active, active.offsetLeft);\n filterBarRef.current.scrollTo({\n behavior: 'smooth',\n left:\n active.offsetLeft -\n (filterBarRef.current.offsetWidth - active.offsetWidth) / 2,\n });\n }\n }, [featuredTags, searchEnabled, ...allSearchParams]);\n\n const accountInstance = useMemo(() => {\n if (!account?.url) return null;\n const domain = URL.parse(account.url).hostname;\n return domain;\n }, [account]);\n const sameInstance = instance === accountInstance;\n const allowSwitch = !!account && !sameInstance;\n\n return (\n <Timeline\n key={id}\n title={`${account?.acct ? '@' + account.acct : t`Posts`}`}\n titleComponent={\n <h1\n class=\"header-double-lines header-account\"\n // onClick={() => {\n // states.showAccount = {\n // account,\n // instance,\n // };\n // }}\n >\n <b>\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n <div>\n <span class=\"bidi-isolate\">@{acct}</span>\n </div>\n </h1>\n }\n id=\"account-statuses\"\n instance={instance}\n emptyText={t`Nothing to see here yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchAccountStatuses}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n boostsCarousel={snapStates.settings.boostsCarousel}\n timelineStart={TimelineStart}\n refresh={[\n excludeReplies,\n excludeBoosts,\n tagged,\n media,\n month + account?.acct,\n ].toString()}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n disabled={!allowSwitch}\n onClick={() => {\n (async () => {\n try {\n const { masto } = api({\n instance: accountInstance,\n });\n const acc = await masto.v1.accounts.lookup({\n acct: account.acct,\n });\n const { id } = acc;\n location.hash = `/${accountInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to account's instance{' '}\n {accountInstance ? (\n <>\n {' '}\n (<b>{punycode.toUnicode(accountInstance)}</b>)\n </>\n ) : null}\n </Trans>\n </small>\n </MenuItem>\n {!sameCurrentInstance && (\n <MenuItem\n onClick={() => {\n (async () => {\n try {\n const acc = await currentMasto.v1.accounts.lookup({\n acct: account.acct + '@' + instance,\n });\n const { id } = acc;\n location.hash = `/${currentInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nfunction MonthPicker(props) {\n const { i18n } = useLingui();\n const {\n class: className,\n disabled,\n value,\n min,\n max,\n onInput = () => {},\n } = props;\n const [_year, _month] = value?.split('-') || [];\n const monthFieldRef = useRef();\n const yearFieldRef = useRef();\n\n const checkValidity = (month, year) => {\n const [minYear, minMonth] = min?.split('-') || [];\n const [maxYear, maxMonth] = max?.split('-') || [];\n if (year < minYear) return false;\n if (year > maxYear) return false;\n if (year === minYear && month < minMonth) return false;\n if (year === maxYear && month > maxMonth) return false;\n return true;\n };\n\n return (\n <div class={className}>\n <Icon icon=\"month\" size=\"l\" />\n <select\n ref={monthFieldRef}\n disabled={disabled}\n value={_month || ''}\n onInput={(e) => {\n const { value: month } = e.currentTarget;\n const year = yearFieldRef.current.value;\n if (!checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: month ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n >\n <option value=\"\">\n <Trans>Month</Trans>\n </option>\n <option disabled>-----</option>\n {Array.from({ length: 12 }, (_, i) => (\n <option\n value={\n // Month is 1-indexed\n (i + 1).toString().padStart(2, '0')\n }\n key={i}\n >\n {new Date(0, i).toLocaleString(i18n.locale, {\n month: 'long',\n })}\n </option>\n ))}\n </select>{' '}\n <input\n ref={yearFieldRef}\n type=\"number\"\n disabled={disabled}\n value={_year || new Date().getFullYear()}\n min={min?.slice(0, 4) || MIN_YEAR}\n max={max?.slice(0, 4) || new Date().getFullYear()}\n onInput={(e) => {\n const { value: year, validity } = e.currentTarget;\n const month = monthFieldRef.current.value;\n if (!validity.valid || !checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: year ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n style={{\n width: '4.5em',\n }}\n />\n </div>\n );\n}\n\nexport default AccountStatuses;\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Bookmarks() {\n useTitle(t`Bookmarks`, '/bookmarks');\n const { masto, instance } = api();\n const bookmarksIterator = useRef();\n async function fetchBookmarks(firstLoad) {\n if (firstLoad || !bookmarksIterator.current) {\n bookmarksIterator.current = masto.v1.bookmarks.list({ limit: LIMIT });\n }\n return await bookmarksIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Bookmarks`}\n id=\"bookmarks\"\n emptyText={t`No bookmarks yet. Go bookmark something!`}\n errorText={t`Unable to load bookmarks.`}\n instance={instance}\n fetchItems={fetchBookmarks}\n />\n );\n}\n\nexport default Bookmarks;\n","export default \"__VITE_ASSET__S_9SYp01__\"","import '../components/links-bar.css';\nimport './catchup.css';\n\nimport autoAnimate from '@formkit/auto-animate';\nimport { msg, Plural, select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSearchParams } from 'react-router-dom';\nimport { uid } from 'uid/single';\n\nimport catchupUrl from '../assets/features/catch-up.png';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport db from '../utils/db';\nimport emojifyText from '../utils/emojify-text';\nimport { isFiltered } from '../utils/filters';\nimport htmlContentLength from '../utils/html-content-length';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID, getCurrentAccountNS } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport { assignFollowedTags } from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = 'home';\n\nconst RANGES = [\n { label: msg`last 1 hour`, value: 1 },\n { label: msg`last 2 hours`, value: 2 },\n { label: msg`last 3 hours`, value: 3 },\n { label: msg`last 4 hours`, value: 4 },\n { label: msg`last 5 hours`, value: 5 },\n { label: msg`last 6 hours`, value: 6 },\n { label: msg`last 7 hours`, value: 7 },\n { label: msg`last 8 hours`, value: 8 },\n { label: msg`last 9 hours`, value: 9 },\n { label: msg`last 10 hours`, value: 10 },\n { label: msg`last 11 hours`, value: 11 },\n { label: msg`last 12 hours`, value: 12 },\n { label: msg`beyond 12 hours`, value: 13 },\n];\n\nconst FILTER_KEYS = {\n original: msg`Original`,\n replies: msg`Replies`,\n boosts: msg`Boosts`,\n followedTags: msg`Followed tags`,\n groups: msg`Groups`,\n filtered: msg`Filtered`,\n};\nconst FILTER_SORTS = [\n 'createdAt',\n 'repliesCount',\n 'favouritesCount',\n 'reblogsCount',\n 'density',\n];\nconst FILTER_GROUPS = [null, 'account'];\n\nconst DTF = mem(\n (locale) =>\n new Intl.DateTimeFormat(locale || undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n }),\n);\n\nfunction Catchup() {\n const { i18n, _ } = useLingui();\n const dtf = DTF(i18n.locale);\n\n useTitle(`Catch-up`, '/catchup');\n const { masto, instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const id = searchParams.get('id');\n const [uiState, setUIState] = useState('start');\n const [showTopLinks, setShowTopLinks] = useState(false);\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = (accountID) => accountID === currentAccount;\n\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome({ maxCreatedAt }) {\n const maxCreatedAtDate = maxCreatedAt ? new Date(maxCreatedAt) : null;\n console.debug('fetchHome', maxCreatedAtDate);\n const allResults = [];\n const homeIterator = masto.v1.timelines.home.list({ limit: 40 });\n mainloop: while (true) {\n try {\n if (supportsPixelfed && homeIterator.nextParams) {\n if (typeof homeIterator.nextParams === 'string') {\n homeIterator.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.next();\n const { value } = results;\n if (value?.length) {\n // This ignores maxCreatedAt filter, but it's ok for now\n await assignFollowedTags(value, instance);\n let addedResults = false;\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const createdAtDate = new Date(item.createdAt);\n if (!maxCreatedAtDate || createdAtDate >= maxCreatedAtDate) {\n // Filtered\n const selfPost = isSelf(\n item.reblog?.account?.id || item.account.id,\n );\n const filterInfo =\n !selfPost &&\n isFiltered(\n item.reblog?.filtered || item.filtered,\n FILTER_CONTEXT,\n );\n if (filterInfo?.action === 'hide') continue;\n item._filtered = filterInfo;\n\n // Followed tags\n const sKey = statusKey(item.id, instance);\n item._followedTags = states.statusFollowedTags[sKey]\n ? [...states.statusFollowedTags[sKey]]\n : [];\n\n allResults.push(item);\n addedResults = true;\n } else {\n // Don't immediately stop, still add the other items that might still be within range\n // break mainloop;\n }\n // Only stop when ALL items are outside of range\n if (!addedResults) {\n break mainloop;\n }\n }\n } else {\n break mainloop;\n }\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n console.error(e);\n break mainloop;\n }\n }\n\n // Post-process all results\n // 1. Threadify - tag 1st-post in a thread\n allResults.forEach((status) => {\n if (status?.inReplyToId) {\n const replyToStatus = allResults.find(\n (s) => s.id === status.inReplyToId,\n );\n if (replyToStatus && !replyToStatus.inReplyToId) {\n replyToStatus._thread = true;\n }\n }\n });\n\n return allResults;\n }\n\n const [posts, setPosts] = useState([]);\n const catchupRangeRef = useRef();\n const catchupLastRef = useRef();\n const NS = useMemo(() => getCurrentAccountNS(), []);\n const handleCatchupClick = useCallback(async ({ duration } = {}) => {\n const now = Date.now();\n const maxCreatedAt = duration ? now - duration : null;\n setUIState('loading');\n const results = await fetchHome({ maxCreatedAt });\n // Namespaced by account ID\n // Possible conflict if ID matches between different accounts from different instances\n const catchupID = `${NS}-${uid()}`;\n try {\n await db.catchup.set(catchupID, {\n id: catchupID,\n posts: results,\n count: results.length,\n startAt: maxCreatedAt,\n endAt: now,\n });\n setSearchParams({ id: catchupID });\n } catch (e) {\n console.error(e, results);\n }\n }, []);\n\n useEffect(() => {\n if (id) {\n (async () => {\n const catchup = await db.catchup.get(id);\n if (catchup) {\n catchup.posts.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1));\n setPosts(catchup.posts);\n setUIState('results');\n }\n })();\n } else if (uiState === 'results') {\n setPosts([]);\n setUIState('start');\n }\n }, [id]);\n\n const [reloadCatchupsCount, reloadCatchups] = useReducer((c) => c + 1, 0);\n const [lastCatchupEndAt, setLastCatchupEndAt] = useState(null);\n const [prevCatchups, setPrevCatchups] = useState([]);\n useEffect(() => {\n (async () => {\n try {\n const catchups = await db.catchup.keys();\n if (catchups.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = catchups.filter((key) => key.startsWith(`${ns}-`));\n if (ownKeys.length) {\n let ownCatchups = await db.catchup.getMany(ownKeys);\n ownCatchups.sort((a, b) => b.endAt - a.endAt);\n\n // Split to 1st 3 last catchups, and the rest\n let lastCatchups = ownCatchups.slice(0, 3);\n let restCatchups = ownCatchups.slice(3);\n\n const trimmedCatchups = lastCatchups.map((c) => {\n const { id, count, startAt, endAt } = c;\n return {\n id,\n count,\n startAt,\n endAt,\n };\n });\n setPrevCatchups(trimmedCatchups);\n setLastCatchupEndAt(lastCatchups[0].endAt);\n\n // GC time\n ownCatchups = null;\n lastCatchups = null;\n\n queueMicrotask(() => {\n if (restCatchups.length) {\n // delete them\n db.catchup\n .delMany(restCatchups.map((c) => c.id))\n .then(() => {\n // GC time\n restCatchups = null;\n })\n .catch((e) => {\n console.error(e);\n });\n }\n });\n\n return;\n }\n }\n } catch (e) {\n console.error(e);\n }\n setPrevCatchups([]);\n })();\n }, [reloadCatchupsCount]);\n useEffect(() => {\n if (uiState === 'start') {\n reloadCatchups();\n }\n }, [uiState === 'start']);\n\n const [filterCounts, links] = useMemo(() => {\n let filtered = 0,\n groups = 0,\n boosts = 0,\n replies = 0,\n followedTags = 0,\n original = 0;\n const links = {};\n for (const post of posts) {\n if (post._filtered) {\n filtered++;\n post.__FILTER = 'filtered';\n } else if (post.group) {\n groups++;\n post.__FILTER = 'groups';\n } else if (post.reblog) {\n boosts++;\n post.__FILTER = 'boosts';\n } else if (post._followedTags?.length) {\n followedTags++;\n post.__FILTER = 'followedTags';\n } else if (\n post.inReplyToId &&\n post.inReplyToAccountId !== post.account?.id\n ) {\n replies++;\n post.__FILTER = 'replies';\n } else {\n original++;\n post.__FILTER = 'original';\n }\n\n const thePost = post.reblog || post;\n if (\n post.__FILTER !== 'filtered' &&\n thePost.card?.url &&\n thePost.card?.image &&\n thePost.card?.type === 'link'\n ) {\n const { card, favouritesCount, reblogsCount } = thePost;\n let { url } = card;\n url = url.replace(/\\/$/, '');\n if (!links[url]) {\n links[url] = {\n postID: thePost.id,\n card,\n shared: 1,\n sharers: [post.account],\n likes: favouritesCount,\n boosts: reblogsCount,\n };\n } else {\n if (links[url].sharers.find((a) => a.id === post.account.id)) {\n continue;\n }\n links[url].shared++;\n links[url].sharers.push(post.account);\n if (links[url].postID !== thePost.id) {\n links[url].likes += favouritesCount;\n links[url].boosts += reblogsCount;\n }\n }\n }\n }\n\n let topLinks = [];\n for (const link in links) {\n topLinks.push({\n url: link,\n ...links[link],\n });\n }\n topLinks.sort((a, b) => {\n if (a.shared > b.shared) return -1;\n if (a.shared < b.shared) return 1;\n if (a.boosts > b.boosts) return -1;\n if (a.boosts < b.boosts) return 1;\n if (a.likes > b.likes) return -1;\n if (a.likes < b.likes) return 1;\n return 0;\n });\n\n // Slice links to shared > 1 but min 10 links\n if (topLinks.length > 10) {\n linksLoop: for (let i = 10; i < topLinks.length; i++) {\n const { shared } = topLinks[i];\n if (shared <= 1) {\n topLinks = topLinks.slice(0, i);\n break linksLoop;\n }\n }\n }\n\n return [\n {\n filtered,\n groups,\n boosts,\n replies,\n followedTags,\n original,\n },\n topLinks,\n ];\n }, [posts]);\n\n const [selectedFilterCategory, setSelectedFilterCategory] = useState('all');\n const [selectedAuthor, setSelectedAuthor] = useState(null);\n\n const [range, setRange] = useState(1);\n\n const [sortBy, setSortBy] = useState('createdAt');\n const [sortOrder, setSortOrder] = useState('asc');\n const [groupBy, setGroupBy] = useState(null);\n\n const [filteredPosts, authors, authorCounts] = useMemo(() => {\n const authorsHash = {};\n const authorCountsMap = new Map();\n\n let filteredPosts = posts.filter((post) => {\n const postFilterMatches =\n selectedFilterCategory === 'all' ||\n post.__FILTER === selectedFilterCategory;\n\n if (postFilterMatches) {\n authorsHash[post.account.id] = post.account;\n authorCountsMap.set(\n post.account.id,\n (authorCountsMap.get(post.account.id) || 0) + 1,\n );\n }\n\n return postFilterMatches;\n });\n\n // Deduplicate boosts\n const boostedPosts = {};\n filteredPosts.forEach((post) => {\n if (post.reblog) {\n if (boostedPosts[post.reblog.id]) {\n if (boostedPosts[post.reblog.id].__BOOSTERS) {\n boostedPosts[post.reblog.id].__BOOSTERS.add(post.account);\n } else {\n boostedPosts[post.reblog.id].__BOOSTERS = new Set([post.account]);\n }\n post.__HIDDEN = true;\n } else {\n boostedPosts[post.reblog.id] = post;\n }\n }\n });\n\n if (selectedAuthor && authorCountsMap.has(selectedAuthor)) {\n filteredPosts = filteredPosts.filter(\n (post) =>\n post.account.id === selectedAuthor ||\n [...(post.__BOOSTERS || [])].find((a) => a.id === selectedAuthor),\n );\n }\n\n return [filteredPosts, authorsHash, Object.fromEntries(authorCountsMap)];\n }, [selectedFilterCategory, selectedAuthor, posts]);\n\n const filteredPostsMap = useMemo(() => {\n const map = {};\n filteredPosts.forEach((post) => {\n map[post.id] = post;\n });\n return map;\n }, [filteredPosts]);\n\n const authorCountsList = useMemo(\n () =>\n Object.keys(authorCounts).sort(\n (a, b) => authorCounts[b] - authorCounts[a],\n ),\n [authorCounts],\n );\n\n const sortedFilteredPosts = useMemo(() => {\n const authorIndices = {};\n authorCountsList.forEach((authorID, index) => {\n authorIndices[authorID] = index;\n });\n return filteredPosts\n .filter((post) => !post.__HIDDEN)\n .sort((a, b) => {\n if (groupBy === 'account') {\n const aAccountID = a.account.id;\n const bAccountID = b.account.id;\n const aIndex = authorIndices[aAccountID];\n const bIndex = authorIndices[bAccountID];\n const order = aIndex - bIndex;\n if (order !== 0) {\n return order;\n }\n }\n if (sortBy !== 'createdAt') {\n a = a.reblog || a;\n b = b.reblog || b;\n if (sortBy !== 'density' && a[sortBy] === b[sortBy]) {\n return a.createdAt > b.createdAt ? 1 : -1;\n }\n }\n if (sortBy === 'density') {\n const aDensity = postDensity(a);\n const bDensity = postDensity(b);\n if (sortOrder === 'asc') {\n return aDensity > bDensity ? 1 : -1;\n } else {\n return bDensity > aDensity ? 1 : -1;\n }\n }\n if (sortOrder === 'asc') {\n return a[sortBy] > b[sortBy] ? 1 : -1;\n } else {\n return b[sortBy] > a[sortBy] ? 1 : -1;\n }\n });\n }, [filteredPosts, sortBy, sortOrder, groupBy, authorCountsList]);\n\n const prevGroup = useRef(null);\n\n const authorsListParent = useRef(null);\n const autoAnimated = useRef(false);\n useEffect(() => {\n if (posts.length > 100 || autoAnimated.current) return;\n if (authorsListParent.current) {\n autoAnimate(authorsListParent.current, {\n duration: 200,\n });\n autoAnimated.current = true;\n }\n }, [posts, authorsListParent]);\n\n const postsBarType = posts.length > 160 ? '3d' : '2d';\n\n const postsBar = useMemo(() => {\n if (postsBarType !== '2d') return null;\n return posts.map((post) => {\n // If part of filteredPosts\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n });\n }, [filteredPostsMap]);\n\n const postsBins = useMemo(() => {\n if (postsBarType !== '3d') return null;\n if (!posts?.length) return null;\n const bins = binByTime(posts, 'createdAt', 320);\n return bins.map((posts, i) => {\n return (\n <div class=\"posts-bin\" key={i}>\n {posts.map((post) => {\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n })}\n </div>\n );\n });\n }, [filteredPostsMap]);\n\n const scrollableRef = useRef(null);\n\n // if range value exceeded lastCatchupEndAt, show error\n const lastCatchupRange = useMemo(() => {\n // return hour, not ms\n if (!lastCatchupEndAt) return null;\n return (Date.now() - lastCatchupEndAt) / 1000 / 60 / 60;\n }, [lastCatchupEndAt, range]);\n\n useEffect(() => {\n if (uiState !== 'results') return;\n const authorUsername =\n selectedAuthor && authors[selectedAuthor]\n ? authors[selectedAuthor].username\n : '';\n const sortOrderIndex = sortOrder === 'asc' ? 0 : 1;\n const groupByText = {\n account: 'authors',\n };\n let toast = showToast({\n duration: 5_000, // 5 seconds\n // Note: I'm sorry, translators\n text: t`Showing ${select(selectedFilterCategory, {\n all: 'all posts',\n original: 'original posts',\n replies: 'replies',\n boosts: 'boosts',\n followedTags: 'followed tags',\n groups: 'groups',\n filtered: 'filtered posts',\n })}, ${select(sortBy, {\n createdAt: select(sortOrder, {\n asc: 'oldest',\n desc: 'latest',\n }),\n reblogsCount: select(sortOrder, {\n asc: 'fewest boosts',\n desc: 'most boosts',\n }),\n favouritesCount: select(sortOrder, {\n asc: 'fewest likes',\n desc: 'most likes',\n }),\n repliesCount: select(sortOrder, {\n asc: 'fewest replies',\n desc: 'most replies',\n }),\n density: select(sortOrder, { asc: 'least dense', desc: 'most dense' }),\n })} first${select(groupBy, {\n account: ', grouped by authors',\n other: '',\n })}`,\n });\n return () => {\n toast?.hideToast?.();\n };\n }, [\n uiState,\n selectedFilterCategory,\n selectedAuthor,\n sortBy,\n sortOrder,\n groupBy,\n authors,\n ]);\n\n useEffect(() => {\n if (selectedAuthor) {\n if (authors[selectedAuthor]) {\n // Check if author is visible and within the scrollable area viewport\n const authorElement = authorsListParent.current.querySelector(\n `[data-author=\"${selectedAuthor}\"]`,\n );\n const scrollableRect =\n authorsListParent.current?.getBoundingClientRect();\n const authorRect = authorElement?.getBoundingClientRect();\n console.log({\n sLeft: scrollableRect.left,\n sRight: scrollableRect.right,\n aLeft: authorRect.left,\n aRight: authorRect.right,\n });\n if (\n authorRect.left < scrollableRect.left ||\n authorRect.right > scrollableRect.right\n ) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n } else if (authorRect.top < 0) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n });\n }\n }\n }\n }, [selectedAuthor, authors]);\n\n const [showHelp, setShowHelp] = useState(false);\n\n const itemsSelector = '.catchup-list > li > a';\n const jRef = useHotkeys(\n 'j',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n const nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const kRef = useHotkeys(\n 'k',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const hlRef = useHotkeys(\n 'h, l',\n (_, handler) => {\n // Go next/prev selectedAuthor in authorCountsList list\n const key = handler.keys[0];\n if (selectedAuthor) {\n const index = authorCountsList.indexOf(selectedAuthor);\n if (key === 'h') {\n if (index > 0 && index < authorCountsList.length) {\n setSelectedAuthor(authorCountsList[index - 1]);\n scrollableRef.current?.focus();\n }\n } else if (key === 'l') {\n if (index < authorCountsList.length - 1 && index >= 0) {\n setSelectedAuthor(authorCountsList[index + 1]);\n scrollableRef.current?.focus();\n }\n }\n } else if (key === 'l') {\n setSelectedAuthor(authorCountsList[0]);\n scrollableRef.current?.focus();\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const escRef = useHotkeys(\n 'esc',\n () => {\n setSelectedAuthor(null);\n scrollableRef.current?.focus();\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const dotRef = useHotkeys(\n '.',\n () => {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const handleArrowKeys = useCallback((e) => {\n const activeElement = document.activeElement;\n const isRadio =\n activeElement?.tagName === 'INPUT' && activeElement.type === 'radio';\n const isArrowKeys =\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight';\n if (isArrowKeys && isRadio) {\n // Note: page scroll won't trigger on first arrow key press due to this. Subsequent presses will.\n activeElement.blur();\n return;\n }\n }, []);\n\n return (\n <div\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n hlRef(node);\n escRef(node);\n }}\n id=\"catchup-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n >\n <div class=\"timeline-deck deck wide\">\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {uiState === 'results' && (\n <Link to=\"/catchup\" class=\"button plain\">\n <Icon icon=\"history2\" size=\"l\" alt={t`Catch-up`} />\n </Link>\n )}\n {uiState === 'start' && (\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n <h1>\n {uiState !== 'start' && (\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n )}\n </h1>\n <div class=\"header-side\">\n {uiState !== 'start' && uiState !== 'loading' && (\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowHelp(true);\n }}\n >\n <Trans>Help</Trans>\n </button>\n )}\n </div>\n </div>\n </header>\n <main onKeyDown={handleArrowKeys}>\n {uiState === 'start' && (\n <div class=\"catchup-start\">\n <h1>\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n </h1>\n <details>\n <summary>\n <Trans>What is this?</Trans>\n </summary>\n <p>\n <Trans>\n Catch-up is a separate timeline for your followings,\n offering a high-level view at a glance, with a simple,\n email-inspired interface to effortlessly sort and filter\n through posts.\n </Trans>\n </p>\n <img\n src={catchupUrl}\n width=\"1200\"\n height=\"900\"\n alt={t`Preview of Catch-up UI`}\n />\n <p>\n <button\n type=\"button\"\n onClick={(e) => {\n e.target.closest('details').open = false;\n }}\n >\n <Trans>Let's catch up</Trans>\n </button>\n </p>\n </details>\n <p>\n <Trans>Let's catch up on the posts from your followings.</Trans>\n </p>\n <p>\n <b>\n <Trans>Show me all posts from…</Trans>\n </b>\n </p>\n <div class=\"catchup-form\">\n <input\n ref={catchupRangeRef}\n type=\"range\"\n value={range}\n min={RANGES[0].value}\n max={RANGES[RANGES.length - 1].value}\n step=\"1\"\n list=\"catchup-ranges\"\n onChange={(e) => setRange(+e.target.value)}\n />{' '}\n <span\n style={{\n width: '8em',\n }}\n >\n {_(RANGES[range - 1].label)}\n <br />\n <small class=\"insignificant\">\n {range == RANGES[RANGES.length - 1].value\n ? t`until the max`\n : niceDateTime(\n new Date(Date.now() - range * 60 * 60 * 1000),\n )}\n </small>\n </span>\n <datalist id=\"catchup-ranges\">\n {RANGES.map(({ label, value }) => (\n <option value={value} label={_(label)} />\n ))}\n </datalist>{' '}\n <button\n type=\"button\"\n onClick={() => {\n if (range < RANGES[RANGES.length - 1].value) {\n let duration;\n if (\n range === RANGES[RANGES.length - 1].value &&\n catchupLastRef.current?.checked\n ) {\n duration = Date.now() - lastCatchupEndAt;\n } else {\n duration = range * 60 * 60 * 1000;\n }\n handleCatchupClick({ duration });\n } else {\n handleCatchupClick();\n }\n }}\n >\n <Trans>Catch up</Trans>\n </button>\n </div>\n {lastCatchupRange && range > lastCatchupRange ? (\n <p class=\"catchup-info\">\n <Icon icon=\"info\" />{' '}\n <Trans>Overlaps with your last catch-up</Trans>\n </p>\n ) : range === RANGES[RANGES.length - 1].value &&\n lastCatchupEndAt ? (\n <p class=\"catchup-info\">\n <label>\n <input\n type=\"checkbox\"\n switch\n checked\n ref={catchupLastRef}\n />{' '}\n <Trans>\n Until the last catch-up (\n {dtf.format(new Date(lastCatchupEndAt))})\n </Trans>\n </label>\n </p>\n ) : null}\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: your instance might only show a maximum of 800 posts\n in the Home timeline regardless of the time range. Could be\n less or more.\n </Trans>\n </small>\n </p>\n {!!prevCatchups?.length && (\n <div class=\"catchup-prev\">\n <p>\n <Trans>Previously…</Trans>\n </p>\n <ul>\n {prevCatchups.map((pc) => (\n <li key={pc.id}>\n <Link to={`/catchup?id=${pc.id}`}>\n <Icon icon=\"history2\" />{' '}\n <span>\n {pc.startAt\n ? dtf.formatRange(\n new Date(pc.startAt),\n new Date(pc.endAt),\n )\n : `… – ${dtf.format(new Date(pc.endAt))}`}\n </span>\n </Link>{' '}\n <span>\n <small class=\"ib insignificant\">\n <Plural\n value={pc.count}\n one=\"# post\"\n other=\"# posts\"\n />\n </small>{' '}\n <button\n type=\"button\"\n class=\"light danger small\"\n onClick={async () => {\n const yes = confirm(t`Remove this catch-up?`);\n if (yes) {\n let st = showToast(\n t`Removing Catch-up ${pc.id}`,\n );\n await db.catchup.del(pc.id);\n st?.hideToast?.();\n showToast(t`Catch-up ${pc.id} removed`);\n reloadCatchups();\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </span>\n </li>\n ))}\n </ul>\n {prevCatchups.length >= 3 && (\n <p>\n <small>\n <Trans>\n Note: Only max 3 will be stored. The rest will be\n automatically removed.\n </Trans>\n </small>\n </p>\n )}\n </div>\n )}\n </div>\n )}\n {uiState === 'loading' && (\n <div class=\"ui-state catchup-start\">\n <Loader abrupt />\n <p class=\"insignificant\">\n <Trans>Fetching posts…</Trans>\n </p>\n <p class=\"insignificant\">\n <Trans>This might take a while.</Trans>\n </p>\n </div>\n )}\n {uiState === 'results' && (\n <>\n <div class=\"catchup-header\">\n {posts.length > 0 && (\n <p>\n <b class=\"ib\">\n {dtf.formatRange(\n new Date(posts[0].createdAt),\n new Date(posts[posts.length - 1].createdAt),\n )}\n </b>\n </p>\n )}\n <aside>\n <button\n hidden={\n selectedFilterCategory === 'all' &&\n !selectedAuthor &&\n sortBy === 'createdAt' &&\n sortOrder === 'asc'\n }\n type=\"button\"\n class=\"plain4 small\"\n onClick={() => {\n setSelectedFilterCategory('all');\n setSelectedAuthor(null);\n setSortBy('createdAt');\n setGroupBy(null);\n setSortOrder('asc');\n }}\n >\n <Trans>Reset filters</Trans>\n </button>\n {links?.length > 0 && (\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => setShowTopLinks(!showTopLinks)}\n >\n <Trans>Top links</Trans>{' '}\n <Icon\n icon=\"chevron-down\"\n style={{\n transform: showTopLinks\n ? 'rotate(180deg)'\n : 'rotate(0deg)',\n }}\n />\n </button>\n )}\n </aside>\n </div>\n <div class=\"shazam-container no-animation\" hidden={!showTopLinks}>\n <div class=\"shazam-container-inner\">\n <div class=\"catchup-top-links links-bar\">\n {links.map((link) => {\n const { card, shared, sharers, likes, boosts } = link;\n const {\n blurhash,\n title,\n description,\n url,\n image,\n imageDescription,\n language,\n width,\n height,\n publishedAt,\n } = card;\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <a\n key={url}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"link-block\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>&middot; </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class=\"description\"\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n <hr />\n <p\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>\n Shared by{' '}\n {sharers.map((s) => {\n const { avatarStatic, displayName } = s;\n return (\n <button\n type=\"button\"\n class=\"plain\"\n style={{\n padding: 0,\n }}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n // Reset and filter to author\n const { id } = s;\n setSelectedAuthor(id);\n setSelectedFilterCategory('all');\n }}\n >\n <Avatar\n url={avatarStatic}\n size=\"s\"\n alt={displayName}\n />\n </button>\n );\n })}\n </Trans>\n </p>\n </div>\n </article>\n </a>\n );\n })}\n </div>\n </div>\n </div>\n {posts.length >= 5 &&\n (postsBarType === '3d' ? (\n <div class=\"catchup-posts-viz-time-bar\">{postsBins}</div>\n ) : (\n <div class=\"catchup-posts-viz-bar\">{postsBar}</div>\n ))}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <label class=\"filter-cat\">\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={selectedFilterCategory.toLowerCase() === 'all'}\n onChange={() => {\n setSelectedFilterCategory('all');\n }}\n />\n <Trans>All</Trans> <span class=\"count\">{posts.length}</span>\n </label>\n {Object.entries(FILTER_KEYS).map(\n ([key, label]) =>\n !!filterCounts[key] && (\n <label\n class=\"filter-cat\"\n key={_(label)}\n title={\n ((filterCounts[key] / posts.length) * 100).toFixed(\n 2,\n ) + '%'\n }\n >\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={\n selectedFilterCategory.toLowerCase() ===\n key.toLowerCase()\n }\n onChange={() => {\n setSelectedFilterCategory(key);\n if (key === 'boosts') {\n setSortBy('reblogsCount');\n setSortOrder('desc');\n setGroupBy(null);\n }\n // setSelectedAuthor(null);\n }}\n />\n {_(label)}{' '}\n <span class=\"count\">{filterCounts[key]}</span>\n </label>\n ),\n )}\n </div>\n )}\n {posts.length >= 2 && !!authorCounts && (\n <div\n class=\"catchup-filters authors-filters\"\n ref={authorsListParent}\n >\n {authorCountsList.map((author) => (\n <label\n class=\"filter-author\"\n data-author={author}\n key={`${author}-${authorCounts[author]}`}\n // Preact messed up the order sometimes, need additional key besides just `author`\n // https://github.com/preactjs/preact/issues/2849\n >\n <input\n type=\"radio\"\n name=\"filter-author\"\n checked={selectedAuthor === author}\n onChange={() => {\n setSelectedAuthor(author);\n // setGroupBy(null);\n }}\n onClick={() => {\n if (selectedAuthor === author) {\n setSelectedAuthor(null);\n }\n }}\n />\n <Avatar\n url={\n authors[author].avatarStatic || authors[author].avatar\n }\n size=\"xxl\"\n alt={`${authors[author].displayName} (@${authors[author].acct})`}\n />{' '}\n <span class=\"count\">{authorCounts[author]}</span>\n <span class=\"username\">{authors[author].username}</span>\n </label>\n ))}\n {authorCountsList.length > 5 && (\n <small\n key=\"authors-count\"\n style={{\n whiteSpace: 'nowrap',\n paddingInline: '1em',\n opacity: 0.33,\n }}\n >\n <Plural\n value={authorCountsList.length}\n one=\"# author\"\n other=\"# authors\"\n />\n </small>\n )}\n </div>\n )}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <span class=\"filter-label\">\n <Trans>Sort</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_SORTS.map((key) => (\n <label\n class=\"filter-sort\"\n key={key}\n onClick={(e) => {\n if (sortBy === key) {\n e.preventDefault();\n e.stopPropagation();\n setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');\n }\n }}\n >\n <input\n type=\"radio\"\n name=\"filter-sort-cat\"\n checked={sortBy === key}\n onChange={() => {\n setSortBy(key);\n const order = /(replies|favourites|reblogs)/.test(\n key,\n )\n ? 'desc'\n : 'asc';\n setSortOrder(order);\n }}\n />\n {\n {\n createdAt: t`Date`,\n repliesCount: t`Replies`,\n favouritesCount: t`Likes`,\n reblogsCount: t`Boosts`,\n density: t`Density`,\n }[key]\n }\n {sortBy === key && (sortOrder === 'asc' ? ' ↑' : ' ↓')}\n </label>\n ))}\n </fieldset>\n {/* <fieldset class=\"radio-field-group\">\n {['asc', 'desc'].map((key) => (\n <label class=\"filter-sort\" key={key}>\n <input\n type=\"radio\"\n name=\"filter-sort-dir\"\n checked={sortOrder === key}\n onChange={() => {\n setSortOrder(key);\n }}\n />\n {key === 'asc' ? '↑' : '↓'}\n </label>\n ))}\n </fieldset> */}\n <span class=\"filter-label\">\n <Trans id=\"group.filter\">Group</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_GROUPS.map((key) => (\n <label class=\"filter-group\" key={key || 'none'}>\n <input\n type=\"radio\"\n name=\"filter-group\"\n checked={groupBy === key}\n onChange={() => {\n setGroupBy(key);\n }}\n disabled={key === 'account' && selectedAuthor}\n />\n {{\n account: t`Authors`,\n }[key] || t`None`}\n </label>\n ))}\n </fieldset>\n {\n selectedAuthor && authorCountsList.length > 1 ? (\n <button\n type=\"button\"\n class=\"plain6 small\"\n onClick={() => {\n setSelectedAuthor(null);\n }}\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>Show all authors</Trans>\n </button>\n ) : null\n // <button\n // type=\"button\"\n // class=\"plain4 small\"\n // onClick={() => {}}\n // >\n // Group by authors\n // </button>\n }\n </div>\n )}\n <ul\n class={`catchup-list catchup-filter-${\n selectedFilterCategory || ''\n } ${sortBy ? `catchup-sort-${sortBy}` : ''} ${\n selectedAuthor && authors[selectedAuthor]\n ? `catchup-selected-author`\n : ''\n } ${groupBy ? `catchup-group-${groupBy}` : ''}`}\n >\n {sortedFilteredPosts.map((post, i) => {\n const id = post.reblog?.id || post.id;\n let showSeparator = false;\n if (groupBy === 'account') {\n if (\n prevGroup.current &&\n post.account.id !== prevGroup.current &&\n i > 0\n ) {\n showSeparator = true;\n }\n prevGroup.current = post.account.id;\n }\n return (\n <Fragment key={`${post.id}-${showSeparator}`}>\n {showSeparator && <li class=\"separator\" />}\n <IntersectionPostLineItem\n to={`/${instance}/s/${id}`}\n post={post}\n root={scrollableRef.current}\n />\n </Fragment>\n );\n })}\n </ul>\n <footer>\n {filteredPosts.length > 5 && (\n <p>\n {selectedFilterCategory === 'boosts'\n ? t`You don't have to read everything.`\n : t`That's all.`}{' '}\n <button\n type=\"button\"\n class=\"textual\"\n onClick={() => {\n scrollableRef.current.scrollTop = 0;\n }}\n >\n <Trans>Back to top</Trans>\n </button>\n .\n </p>\n )}\n </footer>\n </>\n )}\n </main>\n </div>\n {showHelp && (\n <Modal onClose={() => setShowHelp(false)}>\n <div class=\"sheet\" id=\"catchup-help-sheet\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowHelp(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Help</Trans>\n </h2>\n </header>\n <main>\n <dl>\n <dt>\n <Trans>Top links</Trans>\n </dt>\n <dd>\n <Trans>\n Links shared by followings, sorted by shared counts, boosts\n and likes.\n </Trans>\n </dd>\n <dt>\n <Trans>Sort: Density</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are sorted by information density or depth. Shorter\n posts are \"lighter\" while longer posts are \"heavier\". Posts\n with photos are \"heavier\" than posts without photos.\n </Trans>\n </dd>\n <dt>\n <Trans>Group: Authors</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are grouped by authors, sorted by posts count per\n author.\n </Trans>\n </dd>\n <dt>\n <Trans>Keyboard shortcuts</Trans>\n </dt>\n {/* <dd>\n <kbd>j</kbd>: <Trans>Next post</Trans>\n </dd>\n <dd>\n <kbd>k</kbd>: <Trans>Previous post</Trans>\n </dd>\n <dd>\n <kbd>l</kbd>: <Trans>Next author</Trans>\n </dd>\n <dd>\n <kbd>h</kbd>: <Trans>Previous author</Trans>\n </dd>\n <dd>\n <kbd>Enter</kbd>: <Trans>Open post details</Trans>\n </dd>\n <dd>\n <kbd>.</kbd>: <Trans>Scroll to top</Trans>\n </dd> */}\n <dd>\n <table>\n <tbody>\n <tr>\n <td>\n <Trans>Next post</Trans>\n </td>\n <td>\n <kbd>j</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous post</Trans>\n </td>\n <td>\n <kbd>k</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Next author</Trans>\n </td>\n <td>\n <kbd>l</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous author</Trans>\n </td>\n <td>\n <kbd>h</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Open post details</Trans>\n </td>\n <td>\n <kbd>Enter</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Scroll to top</Trans>\n </td>\n <td>\n <kbd>.</kbd>\n </td>\n </tr>\n </tbody>\n </table>\n </dd>\n </dl>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nconst PostLine = memo(\n function ({ post }) {\n const {\n id,\n account,\n group,\n reblog,\n inReplyToId,\n inReplyToAccountId,\n _followedTags: isFollowedTags,\n _filtered: filterInfo,\n visibility,\n __BOOSTERS,\n } = post;\n const isReplyTo = inReplyToId && inReplyToAccountId !== account.id;\n const isFiltered = !!filterInfo;\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...post,\n });\n }\n };\n\n return (\n <article\n class={`post-line ${\n group\n ? 'group'\n : reblog\n ? 'reblog'\n : isFollowedTags?.length\n ? 'followed-tags'\n : ''\n } ${isReplyTo ? 'reply-to' : ''} ${\n isFiltered ? 'filtered' : ''\n } visibility-${visibility}`}\n onMouseEnter={debugHover}\n >\n <span class=\"post-author\">\n {reblog ? (\n <span class=\"post-reblog-avatar\">\n <Avatar\n url={account.avatarStatic || account.avatar}\n squircle={account.bot}\n />\n {__BOOSTERS?.size > 0\n ? [...__BOOSTERS].map((b) => (\n <Avatar url={b.avatarStatic || b.avatar} squircle={b.bot} />\n ))\n : ''}{' '}\n <Icon icon=\"rocket\" />{' '}\n {/* <Avatar\n url={reblog.account.avatarStatic || reblog.account.avatar}\n squircle={reblog.account.bot}\n /> */}\n <NameText account={reblog.account} showAvatar />\n </span>\n ) : (\n <NameText account={account} showAvatar />\n )}\n </span>\n <PostPeek post={reblog || post} filterInfo={filterInfo} />\n <span class=\"post-meta\">\n <PostStats post={reblog || post} />{' '}\n <RelativeTime\n datetime={new Date(reblog?.createdAt || post.createdAt)}\n format=\"micro\"\n />\n </span>\n </article>\n );\n },\n (oldProps, newProps) => {\n return oldProps?.post?.id === newProps?.post?.id;\n },\n);\n\nconst IntersectionPostLineItem = ({ root, to, ...props }) => {\n const ref = useRef();\n const [show, setShow] = useState(false);\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n if (entry.isIntersecting) {\n queueMicrotask(() => setShow(true));\n observer.unobserve(ref.current);\n }\n },\n {\n root,\n rootMargin: `${Math.max(320, screen.height * 0.75)}px`,\n },\n );\n if (ref.current) observer.observe(ref.current);\n return () => {\n if (ref.current) observer.unobserve(ref.current);\n };\n }, []);\n\n return show ? (\n <li>\n <Link to={to}>\n <PostLine {...props} />\n </Link>\n </li>\n ) : (\n <li ref={ref} style={{ height: '4em' }} />\n );\n};\n\n// A media speak a thousand words\nconst MEDIA_DENSITY = 8;\nconst CARD_DENSITY = 8;\nfunction postDensity(post) {\n const { spoilerText, content, poll, mediaAttachments, card } = post;\n const pollContent = poll?.options?.length\n ? poll.options.reduce((acc, cur) => acc + cur.title, '')\n : '';\n const density =\n (spoilerText.length + htmlContentLength(content) + pollContent.length) /\n 140 +\n (mediaAttachments?.length\n ? MEDIA_DENSITY * mediaAttachments.length\n : card?.image\n ? CARD_DENSITY\n : 0);\n return density;\n}\n\nconst MEDIA_SIZE = 48;\n\nfunction PostPeek({ post, filterInfo }) {\n const {\n spoilerText,\n sensitive,\n content,\n emojis,\n poll,\n mediaAttachments,\n card,\n inReplyToId,\n inReplyToAccountId,\n account,\n _thread,\n } = post;\n const isThread =\n (inReplyToId && inReplyToAccountId === account.id) || !!_thread;\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = store.account.get('preferences') || {};\n return !!prefs['reading:expand:spoilers'];\n }, []);\n // const readingExpandSpoilers = true;\n const showMedia = readingExpandSpoilers || (!spoilerText && !sensitive);\n const postText = content ? statusPeek(post) : '';\n\n const showPostContent = !spoilerText || readingExpandSpoilers;\n\n return (\n <div class=\"post-peek\" title={!spoilerText ? postText : ''}>\n <span class=\"post-peek-content\">\n {isThread && !showPostContent && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">Thread</span>{' '}\n </>\n )}\n {!!filterInfo ? (\n <span class=\"post-peek-filtered\">\n {/* Filtered{filterInfo?.titlesStr ? `: ${filterInfo.titlesStr}` : ''} */}\n {filterInfo?.titlesStr\n ? t`Filtered: ${filterInfo.titlesStr}`\n : t`Filtered`}\n </span>\n ) : (\n <>\n {!!spoilerText && (\n <span class=\"post-peek-spoiler\">\n <Icon\n icon={`${readingExpandSpoilers ? 'eye-open' : 'eye-close'}`}\n />{' '}\n {spoilerText}\n </span>\n )}\n {showPostContent && (\n <div class=\"post-peek-html\">\n {isThread && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">\n <Trans>Thread</Trans>\n </span>{' '}\n </>\n )}\n {!!content && (\n <div\n dangerouslySetInnerHTML={{\n __html: emojifyText(content, emojis),\n }}\n />\n )}\n {!!poll?.options?.length &&\n poll.options.map((o) => (\n <div>\n {poll.multiple ? '▪️' : '•'} {o.title}\n </div>\n ))}\n {!content &&\n mediaAttachments?.length === 1 &&\n mediaAttachments[0].description && (\n <>\n <span class=\"post-peek-tag post-peek-alt\">ALT</span>{' '}\n <div>{mediaAttachments[0].description}</div>\n </>\n )}\n </div>\n )}\n </>\n )}\n </span>\n {!filterInfo && (\n <span class=\"post-peek-post-content\">\n {!!poll && (\n <span class=\"post-peek-tag post-peek-poll\">\n <Icon icon=\"poll\" size=\"s\" />\n <Trans>Poll</Trans>\n </span>\n )}\n {!!mediaAttachments?.length\n ? mediaAttachments.map((m) => {\n const mediaURL = m.previewUrl || m.url;\n const remoteMediaURL = m.previewRemoteUrl || m.remoteUrl;\n const width = m.meta?.original\n ? m.meta.original.width\n : m.meta?.small?.width || m.meta?.original?.width;\n const height = m.meta?.original\n ? m.meta.original.height\n : m.meta?.small?.height || m.meta?.original?.height;\n return (\n <span key={m.id} class=\"post-peek-media\">\n {{\n image:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n style={{\n '--anim-duration': `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🖼</span>\n ),\n gifv:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🎞️</span>\n ),\n video:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">📹</span>\n ),\n audio: <span class=\"post-peek-faux-media\">🎵</span>,\n }[m.type] || null}\n </span>\n );\n })\n : !!card &&\n card.image &&\n showMedia && (\n <span\n class={`post-peek-media post-peek-card card-${\n card.type || ''\n }`}\n >\n {card.image ? (\n <img\n src={card.image}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={\n card.title || card.description || card.imageDescription\n }\n loading=\"lazy\"\n style={{\n '--anim-duration':\n card.width &&\n card.height &&\n `${Math.min(\n Math.max(\n Math.max(card.width, card.height) / 100,\n 5,\n ),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🔗</span>\n )}\n </span>\n )}\n </span>\n )}\n </div>\n );\n}\n\nfunction PostStats({ post }) {\n const { reblogsCount, repliesCount, favouritesCount } = post;\n return (\n <span class=\"post-stats\">\n {repliesCount > 0 && (\n <span class=\"post-stat-replies\">\n <Icon icon=\"comment2\" size=\"s\" alt={t`Replies`} />{' '}\n {shortenNumber(repliesCount)}\n </span>\n )}\n {favouritesCount > 0 && (\n <span class=\"post-stat-likes\">\n <Icon icon=\"heart\" size=\"s\" alt={t`Likes`} />{' '}\n {shortenNumber(favouritesCount)}\n </span>\n )}\n {reblogsCount > 0 && (\n <span class=\"post-stat-boosts\">\n <Icon icon=\"rocket\" size=\"s\" alt={t`Boosts`} />{' '}\n {shortenNumber(reblogsCount)}\n </span>\n )}\n </span>\n );\n}\n\nfunction binByTime(data, key, numBins) {\n // Extract dates from data objects\n const dates = data.map((item) => new Date(item[key]));\n\n // Find minimum and maximum dates directly (avoiding Math.min/max)\n const minDate = dates.reduce(\n (acc, date) => (date < acc ? date : acc),\n dates[0],\n );\n const maxDate = dates.reduce(\n (acc, date) => (date > acc ? date : acc),\n dates[0],\n );\n\n // Calculate the time span in milliseconds\n const range = maxDate.getTime() - minDate.getTime();\n\n // Create empty bins and loop through data\n const bins = Array.from({ length: numBins }, () => []);\n data.forEach((item) => {\n const date = new Date(item[key]);\n const normalized = (date.getTime() - minDate.getTime()) / range;\n const binIndex = Math.floor(normalized * (numBins - 1));\n bins[binIndex].push(item);\n });\n\n return bins;\n}\n\nexport default Catchup;\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Favourites() {\n useTitle(t`Likes`, '/favourites');\n const { masto, instance } = api();\n const favouritesIterator = useRef();\n async function fetchFavourites(firstLoad) {\n if (firstLoad || !favouritesIterator.current) {\n favouritesIterator.current = masto.v1.favourites.list({ limit: LIMIT });\n }\n return await favouritesIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Likes`}\n id=\"favourites\"\n emptyText={t`No likes yet. Go like something!`}\n errorText={t`Unable to load likes.`}\n instance={instance}\n fetchItems={fetchFavourites}\n />\n );\n}\n\nexport default Favourites;\n","import './filters.css';\n\nimport { i18n } from '@lingui/core';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { useEffect, useReducer, useRef, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport i18nDuration from '../utils/i18n-duration';\nimport useInterval from '../utils/useInterval';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_UNIMPLEMENTED = ['notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_LABELS = {\n home: msg`Home and lists`,\n notifications: msg`Notifications`,\n public: msg`Public timelines`,\n thread: msg`Conversations`,\n account: msg`Profiles`,\n};\n\nconst EXPIRY_DURATIONS = [\n 0, // forever\n 30 * 60, // 30 minutes\n 60 * 60, // 1 hour\n 6 * 60 * 60, // 6 hours\n 12 * 60 * 60, // 12 hours\n 60 * 60 * 24, // 24 hours\n 60 * 60 * 24 * 7, // 7 days\n 60 * 60 * 24 * 30, // 30 days\n];\n\nconst EXPIRY_DURATIONS_LABELS = {\n 0: msg`Never`,\n 1800: i18nDuration(30, 'minute'),\n 3600: i18nDuration(1, 'hour'),\n 21600: i18nDuration(6, 'hour'),\n 43200: i18nDuration(12, 'hour'),\n 86_400: i18nDuration(24, 'hour'),\n 604_800: i18nDuration(7, 'day'),\n 2_592_000: i18nDuration(30, 'day'),\n};\n\nfunction Filters() {\n const { masto } = api();\n useTitle(t`Filters`, `/ft`);\n const [uiState, setUIState] = useState('default');\n const [showFiltersAddEditModal, setShowFiltersAddEditModal] = useState(false);\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [filters, setFilters] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const filters = await masto.v2.filters.list();\n filters.sort((a, b) => a.title.localeCompare(b.title));\n filters.forEach((filter) => {\n if (filter.keywords?.length) {\n filter.keywords.sort((a, b) => a.id - b.id);\n }\n });\n console.log(filters);\n setFilters(filters);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n return (\n <div id=\"filters-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Filters</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal(true);\n }}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New filter`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {filters.length > 0 ? (\n <>\n <ul class=\"filters-list\">\n {filters.map((filter) => {\n const { id, title, expiresAt, keywords } = filter;\n return (\n <li key={id}>\n <div>\n <h2>{title}</h2>\n {keywords?.length > 0 && (\n <div>\n {keywords.map((k) => (\n <>\n <span class=\"tag collapsed insignificant\">\n {k.wholeWord ? `“${k.keyword}”` : k.keyword}\n </span>{' '}\n </>\n ))}\n </div>\n )}\n <small class=\"insignificant\">\n <ExpiryStatus expiresAt={expiresAt} />\n </small>\n </div>\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal({\n filter,\n });\n }}\n >\n <Icon icon=\"pencil\" size=\"l\" alt=\"Edit filter\" />\n </button>\n </li>\n );\n })}\n </ul>\n {filters.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={filters.length}\n one=\"# filter\"\n other=\"# filters\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load filters.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No filters yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {!!showFiltersAddEditModal && (\n <Modal\n title={t`Add filter`}\n onClose={() => {\n setShowFiltersAddEditModal(false);\n }}\n >\n <FiltersAddEdit\n filter={showFiltersAddEditModal?.filter}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowFiltersAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nlet _id = 1;\nconst incID = () => _id++;\nfunction FiltersAddEdit({ filter, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!filter;\n const { context, expiresAt, id, keywords, title, filterAction } =\n filter || {};\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const [editKeywords, setEditKeywords] = useState(keywords || []);\n const keywordsRef = useRef();\n\n // Hacky way of handling removed keywords for both existing and new ones\n const [removedKeywordIDs, setRemovedKeywordIDs] = useState([]);\n const [removedKeyword_IDs, setRemovedKeyword_IDs] = useState([]);\n\n const filteredEditKeywords = editKeywords.filter(\n (k) =>\n !removedKeywordIDs.includes(k.id) && !removedKeyword_IDs.includes(k._id),\n );\n\n return (\n <div class=\"sheet\" id=\"filters-add-edit-modal\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>{editMode ? t`Edit filter` : t`New filter`}</h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const keywordIDs = formData.getAll('keyword_attributes[][id]');\n const keywordKeywords = formData.getAll(\n 'keyword_attributes[][keyword]',\n );\n // const keywordWholeWords = formData.getAll(\n // 'keyword_attributes[][whole_word]',\n // );\n // Not using getAll because it skips the empty checkboxes\n const keywordWholeWords = [\n ...keywordsRef.current.querySelectorAll(\n 'input[name=\"keyword_attributes[][whole_word]\"]',\n ),\n ].map((i) => i.checked);\n const keywordsAttributes = keywordKeywords.map((k, i) => ({\n id: keywordIDs[i] || undefined,\n keyword: k,\n wholeWord: keywordWholeWords[i],\n }));\n // if (editMode && keywords?.length) {\n // // Find which one got deleted and add to keywordsAttributes\n // keywords.forEach((k) => {\n // if (!keywordsAttributes.find((ka) => ka.id === k.id)) {\n // keywordsAttributes.push({\n // ...k,\n // _destroy: true,\n // });\n // }\n // });\n // }\n if (editMode && removedKeywordIDs?.length) {\n removedKeywordIDs.forEach((id) => {\n keywordsAttributes.push({\n id,\n _destroy: true,\n });\n });\n }\n const context = formData.getAll('context');\n let expiresIn = formData.get('expires_in');\n const filterAction = formData.get('filter_action');\n console.log({\n title,\n keywordIDs,\n keywords: keywordKeywords,\n wholeWords: keywordWholeWords,\n keywordsAttributes,\n context,\n expiresIn,\n filterAction,\n });\n\n // Required fields\n if (!title || !context?.length) {\n return;\n }\n\n setUIState('loading');\n\n (async () => {\n try {\n let filterResult;\n\n if (editMode) {\n if (expiresIn === '' || expiresIn === null) {\n // No value\n // Preserve existing expiry if not specified\n // Seconds from now to expiresAtDate\n // Other clients don't do this\n if (hasExpiry) {\n expiresIn = Math.floor(\n (expiresAtDate - new Date()) / 1000,\n );\n } else {\n expiresIn = null;\n }\n } else if (expiresIn === '0' || expiresIn === 0) {\n // 0 = Never\n expiresIn = null;\n } else {\n expiresIn = +expiresIn;\n }\n filterResult = await masto.v2.filters.$select(id).update({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n } else {\n expiresIn = +expiresIn || null;\n filterResult = await masto.v2.filters.create({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n }\n console.log({ filterResult });\n setUIState('default');\n onClose?.({\n state: 'success',\n filter: filterResult,\n });\n } catch (error) {\n console.error(error);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit filter`\n : t`Unable to create filter`,\n );\n }\n })();\n }}\n >\n <div class=\"filter-form-row\">\n <label>\n <b>\n <Trans>Title</Trans>\n </b>\n <input\n type=\"text\"\n name=\"title\"\n defaultValue={title}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n required\n />\n </label>\n </div>\n <div class=\"filter-form-keywords\" ref={keywordsRef}>\n {filteredEditKeywords.length ? (\n <ul class=\"filter-keywords\">\n {filteredEditKeywords.map((k) => {\n const { id, keyword, wholeWord, _id } = k;\n return (\n <li key={`${id}-${_id}`}>\n <input\n type=\"hidden\"\n name=\"keyword_attributes[][id]\"\n value={id}\n />\n <input\n name=\"keyword_attributes[][keyword]\"\n type=\"text\"\n defaultValue={keyword}\n disabled={uiState === 'loading'}\n required\n dir=\"auto\"\n />\n <div class=\"filter-keyword-actions\">\n <label>\n <input\n name=\"keyword_attributes[][whole_word]\"\n type=\"checkbox\"\n value={id} // Hacky way to map checkbox boolean to the keyword id\n defaultChecked={wholeWord}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Whole word</Trans>\n </label>\n <button\n type=\"button\"\n class=\"light danger small\"\n disabled={uiState === 'loading'}\n onClick={() => {\n if (id) {\n removedKeywordIDs.push(id);\n setRemovedKeywordIDs([...removedKeywordIDs]);\n } else if (_id) {\n removedKeyword_IDs.push(_id);\n setRemovedKeyword_IDs([...removedKeyword_IDs]);\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </div>\n </li>\n );\n })}\n </ul>\n ) : (\n <div class=\"filter-keywords\">\n <div class=\"insignificant\">\n <Trans>No keywords. Add one.</Trans>\n </div>\n </div>\n )}\n <footer class=\"filter-keywords-footer\">\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setEditKeywords([\n ...editKeywords,\n {\n _id: incID(),\n keyword: '',\n wholeWord: true,\n },\n ]);\n setTimeout(() => {\n // Focus last input\n const fields =\n keywordsRef.current.querySelectorAll(\n 'input[type=\"text\"]',\n );\n fields[fields.length - 1]?.focus?.();\n }, 10);\n }}\n >\n <Trans>Add keyword</Trans>\n </button>{' '}\n {filteredEditKeywords?.length > 1 && (\n <small class=\"insignificant\">\n <Plural\n value={filteredEditKeywords.length}\n one=\"# keyword\"\n other=\"# keywords\"\n />\n </small>\n )}\n </footer>\n </div>\n <div class=\"filter-form-cols\">\n <div class=\"filter-form-col\">\n <div>\n <b>\n <Trans>Filter from…</Trans>\n </b>\n </div>\n {FILTER_CONTEXT.map((ctx) => (\n <div>\n <label\n class={\n FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx)\n ? 'insignificant'\n : ''\n }\n >\n <input\n type=\"checkbox\"\n name=\"context\"\n value={ctx}\n defaultChecked={!!context ? context.includes(ctx) : true}\n disabled={uiState === 'loading'}\n />{' '}\n {_(FILTER_CONTEXT_LABELS[ctx])}\n {FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx) ? '*' : ''}\n </label>{' '}\n </div>\n ))}\n <p>\n <small class=\"insignificant\">\n <Trans>* Not implemented yet</Trans>\n </small>\n </p>\n </div>\n <div class=\"filter-form-col\">\n {editMode && (\n <Trans>\n Status:{' '}\n <b>\n <ExpiryStatus expiresAt={expiresAt} showNeverExpires />\n </b>\n </Trans>\n )}\n <div>\n <label for=\"filters-expires_in\">\n {editMode ? t`Change expiry` : t`Expiry`}\n </label>\n <select\n id=\"filters-expires_in\"\n name=\"expires_in\"\n disabled={uiState === 'loading'}\n defaultValue={editMode ? undefined : 0}\n >\n {editMode && <option></option>}\n {EXPIRY_DURATIONS.map((v) => (\n <option value={v}>\n {typeof EXPIRY_DURATIONS_LABELS[v] === 'function'\n ? EXPIRY_DURATIONS_LABELS[v]()\n : _(EXPIRY_DURATIONS_LABELS[v])}\n </option>\n ))}\n </select>\n </div>\n <p>\n <Trans>Filtered post will be…</Trans>\n <br />\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"warn\"\n defaultChecked={filterAction === 'warn' || !editMode}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>minimized</Trans>\n </label>{' '}\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"hide\"\n defaultChecked={filterAction === 'hide'}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>hidden</Trans>\n </label>\n </p>\n </div>\n </div>\n <footer class=\"filter-form-footer\">\n <span>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </span>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this filter?`}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v2.filters.$select(id).remove();\n setUIState('default');\n onClose?.({\n state: 'success',\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete filter.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {}}\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ExpiryStatus({ expiresAt, showNeverExpires }) {\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const expired = hasExpiry && expiresAtDate <= new Date();\n\n // If less than a minute left, re-render interval every second, else every minute\n const [_, rerender] = useReducer((c) => c + 1, 0);\n useInterval(rerender, expired || 30_000);\n\n return expired ? (\n t`Expired`\n ) : hasExpiry ? (\n <Trans>\n Expiring <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n showNeverExpires && t`Never expires`\n );\n}\n\nexport default Filters;\n","import { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport useTitle from '../utils/useTitle';\n\nfunction FollowedHashtags() {\n const { masto, instance } = api();\n useTitle(t`Followed Hashtags`, `/fh`);\n const [uiState, setUIState] = useState('default');\n\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n return (\n <div id=\"followed-hashtags-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Followed Hashtags</Trans>\n </h1>\n <div class=\"header-side\" />\n </div>\n </header>\n <main>\n {followedHashtags.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {followedHashtags.map((tag) => (\n <li>\n <Link\n to={\n instance\n ? `/${instance}/t/${tag.name}`\n : `/t/${tag.name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" /> <span>{tag.name}</span>\n </Link>\n </li>\n ))}\n </ul>\n {followedHashtags.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={followedHashtags.length}\n one=\"# hashtag\"\n other=\"# hashtags\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load followed hashtags.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags followed yet.</Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default FollowedHashtags;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { getStatus, saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport {\n assignFollowedTags,\n clearFollowedTagsState,\n dedupeBoosts,\n} from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Following({ title, path, id, ...props }) {\n useTitle(\n title ||\n t({\n id: 'following.title',\n message: 'Following',\n }),\n path || '/following',\n );\n const { masto, streaming, instance } = api();\n const snapStates = useSnapshot(states);\n const homeIterator = useRef();\n const latestItem = useRef();\n __BENCHMARK.end('time-to-following');\n\n console.debug('RENDER Following', title, id);\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome(firstLoad) {\n if (firstLoad || !homeIterator.current) {\n __BENCHMARK.start('fetch-home-first');\n homeIterator.current = masto.v1.timelines.home.list({ limit: LIMIT });\n }\n if (supportsPixelfed && homeIterator.current?.nextParams) {\n if (typeof homeIterator.current.nextParams === 'string') {\n homeIterator.current.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.current.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.current.next();\n let { value } = results;\n if (value?.length) {\n let latestItemChanged = false;\n if (firstLoad) {\n if (value[0].id !== latestItem.current) {\n latestItemChanged = true;\n }\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n value = dedupeBoosts(value, instance);\n if (firstLoad && latestItemChanged) clearFollowedTagsState();\n assignFollowedTags(value, instance);\n\n // ENFORCE sort by datetime (Latest first)\n value.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return bDate - aDate;\n });\n }\n __BENCHMARK.end('fetch-home-first');\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const opts = {\n limit: 5,\n since_id: latestItem.current,\n };\n if (supports('@pixelfed/home-include-reblogs')) {\n opts.include_reblogs = true;\n }\n const results = await masto.v1.timelines.home.list(opts).next();\n let { value } = results;\n console.log('checkForUpdates', latestItem.current, value);\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestItem.current = value[0].id;\n value = dedupeBoosts(value, instance);\n value = filteredItems(value, 'home');\n if (value.some((item) => !item.reblog)) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n useEffect(() => {\n let sub;\n (async () => {\n if (streaming) {\n sub = streaming.user.subscribe();\n console.log('🎏 Streaming user', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (entry.event === 'status.update') {\n const status = entry.payload;\n console.log(`🔄 Status ${status.id} updated`);\n saveStatus(status, instance);\n } else if (entry.event === 'delete') {\n const statusID = entry.payload;\n console.log(`❌ Status ${statusID} deleted`);\n // delete states.statuses[statusID];\n const s = getStatus(statusID, instance);\n if (s) s._deleted = true;\n }\n }\n console.log('💥 Streaming user loop STOPPED');\n }\n })();\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n };\n }, [streaming]);\n\n return (\n <Timeline\n title={title || t({ id: 'following.title', message: 'Following' })}\n id={id || 'following'}\n emptyText={t`Nothing to see here.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchHome}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n {...props}\n // allowFilters\n filterContext=\"home\"\n showFollowedTags\n showReplyParent\n />\n );\n}\n\nexport default Following;\n","import { plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n FocusableItem,\n MenuDivider,\n MenuGroup,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useNavigate, useParams, useSearchParams } from 'react-router-dom';\n\nimport Icon from '../components/icon';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport { SHORTCUTS_LIMIT } from '../components/shortcuts-settings';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\n// Limit is 4 per \"mode\"\n// https://github.com/mastodon/mastodon/issues/15194\n// Hard-coded https://github.com/mastodon/mastodon/blob/19614ba2477f3d12468f5ec251ce1cc5f8c6210c/app/models/tag_feed.rb#L4\nconst TAGS_LIMIT_PER_MODE = 4;\nconst TOTAL_TAGS_LIMIT = TAGS_LIMIT_PER_MODE + 1;\n\nfunction Hashtags({ media: mediaView, columnMode, ...props }) {\n // const navigate = useNavigate();\n let { hashtag, ...params } = columnMode ? {} : useParams();\n if (props.hashtag) hashtag = props.hashtag;\n let hashtags = hashtag.trim().split(/[\\s+]+/);\n hashtags.sort();\n hashtag = hashtags[0];\n const [searchParams, setSearchParams] = useSearchParams();\n const media = mediaView || !!searchParams.get('media');\n const linkParams = media ? '?media=1' : '';\n\n const { masto, instance, authenticated } = api({\n instance: props?.instance || params.instance,\n });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const hashtagTitle = hashtags.map((t) => `#${t}`).join(' ');\n const title = instance\n ? media\n ? t`${hashtagTitle} (Media only) on ${instance}`\n : t`${hashtagTitle} on ${instance}`\n : media\n ? t`${hashtagTitle} (Media only)`\n : t`${hashtagTitle}`;\n useTitle(title, `/:instance?/t/:hashtag`);\n const latestItem = useRef();\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n // const hashtagsIterator = useRef();\n const maxID = useRef(undefined);\n async function fetchHashtags(firstLoad) {\n // if (firstLoad || !hashtagsIterator.current) {\n // hashtagsIterator.current = masto.v1.timelines.tag.$select(hashtag).list({\n // limit: LIMIT,\n // any: hashtags.slice(1),\n // });\n // }\n // const results = await hashtagsIterator.current.next();\n\n // NOTE: Temporary fix for listHashtag not persisting `any` in subsequent calls.\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: LIMIT,\n any: hashtags.slice(1),\n maxId: firstLoad ? undefined : maxID.current,\n onlyMedia: media ? true : undefined,\n })\n .next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance, {\n skipThreading: media || mediaFirst, // If media view, no need to form threads\n });\n });\n\n maxID.current = value[value.length - 1].id;\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: 1,\n any: hashtags.slice(1),\n since_id: latestItem.current,\n onlyMedia: media,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [followUIState, setFollowUIState] = useState('default');\n const [info, setInfo] = useState();\n // Get hashtag info\n useEffect(() => {\n (async () => {\n try {\n const info = await masto.v1.tags.$select(hashtag).fetch();\n console.log(info);\n setInfo(info);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [hashtag]);\n\n const reachLimit = hashtags.length >= TOTAL_TAGS_LIMIT;\n\n const [featuredUIState, setFeaturedUIState] = useState('default');\n const [featuredTags, setFeaturedTags] = useState([]);\n const [isFeaturedTag, setIsFeaturedTag] = useState(false);\n useEffect(() => {\n if (!authenticated) return;\n (async () => {\n try {\n const featuredTags = await masto.v1.featuredTags.list();\n setFeaturedTags(featuredTags);\n setIsFeaturedTag(\n featuredTags.some(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ),\n );\n } catch (e) {\n console.error(e);\n }\n })();\n }, []);\n\n return (\n <Timeline\n key={instance + hashtagTitle}\n title={title}\n titleComponent={\n !!instance && (\n <h1 class=\"header-double-lines\">\n <b dir=\"auto\">{hashtagTitle}</b>\n <div>{instance}</div>\n </h1>\n )\n }\n id=\"hashtag\"\n instance={instance}\n emptyText={t`No one has posted anything with this tag yet.`}\n errorText={t`Unable to load posts with this tag`}\n fetchItems={fetchHashtags}\n checkForUpdates={checkForUpdates}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n refresh={media}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n // viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {!!info && hashtags.length === 1 && (\n <>\n <MenuConfirm\n subMenu\n confirm={info.following}\n confirmLabel={t`Unfollow #${hashtag}?`}\n disabled={followUIState === 'loading' || !authenticated}\n onClick={() => {\n setFollowUIState('loading');\n if (info.following) {\n // const yes = confirm(`Unfollow #${hashtag}?`);\n // if (!yes) {\n // setFollowUIState('default');\n // return;\n // }\n masto.v1.tags\n .$select(hashtag)\n .unfollow()\n .then(() => {\n setInfo({ ...info, following: false });\n showToast(t`Unfollowed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n } else {\n masto.v1.tags\n .$select(hashtag)\n .follow()\n .then(() => {\n setInfo({ ...info, following: true });\n showToast(t`Followed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n }\n }}\n >\n {info.following ? (\n <>\n <Icon icon=\"check-circle\" />{' '}\n <span>\n <Trans>Following…</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n type=\"checkbox\"\n checked={isFeaturedTag}\n disabled={featuredUIState === 'loading' || !authenticated}\n onClick={() => {\n setFeaturedUIState('loading');\n if (isFeaturedTag) {\n const featuredTagID = featuredTags.find(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ).id;\n if (featuredTagID) {\n masto.v1.featuredTags\n .$select(featuredTagID)\n .remove()\n .then(() => {\n setIsFeaturedTag(false);\n showToast(t`Unfeatured on profile`);\n setFeaturedTags(\n featuredTags.filter(\n (tag) => tag.id !== featuredTagID,\n ),\n );\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n } else {\n showToast(t`Unable to unfeature on profile`);\n }\n } else {\n masto.v1.featuredTags\n .create({\n name: hashtag,\n })\n .then((value) => {\n setIsFeaturedTag(true);\n showToast(t`Featured on profile`);\n setFeaturedTags(featuredTags.concat(value));\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n }\n }}\n >\n {isFeaturedTag ? (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Featured on profile</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Feature on profile</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n </>\n )}\n {!mediaFirst && (\n <>\n <MenuHeader className=\"plain\">\n <Trans>Filters</Trans>\n </MenuHeader>\n <MenuItem\n type=\"checkbox\"\n checked={!!media}\n onClick={() => {\n if (media) {\n searchParams.delete('media');\n } else {\n searchParams.set('media', '1');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />{' '}\n <span class=\"menu-grow\">\n <Trans>Media only</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </>\n )}\n <FocusableItem className=\"menu-field\" disabled={reachLimit}>\n {({ ref }) => (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const newHashtag = e.target[0].value?.trim?.();\n // Use includes but need to be case insensitive\n if (\n newHashtag &&\n !hashtags.some(\n (t) => t.toLowerCase() === newHashtag.toLowerCase(),\n )\n ) {\n hashtags.push(newHashtag);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"hashtag\" />\n <input\n ref={ref}\n type=\"text\"\n placeholder={\n reachLimit\n ? plural(TOTAL_TAGS_LIMIT, {\n other: 'Max # tags',\n })\n : t`Add hashtag`\n }\n required\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n // no spaces, no hashtags\n pattern=\"[^#][^\\s#]+[^#]\"\n disabled={reachLimit}\n dir=\"auto\"\n />\n </form>\n )}\n </FocusableItem>\n <MenuGroup takeOverflow>\n {hashtags.map((tag, i) => (\n <MenuItem\n key={tag}\n disabled={hashtags.length === 1}\n onClick={(e) => {\n hashtags.splice(i, 1);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}${linkParams}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }}\n >\n <Icon icon=\"x\" alt={t`Remove hashtag`} class=\"danger-icon\" />\n <span class=\"bidi-isolate\">\n <span class=\"more-insignificant\">#</span>\n {tag}\n </span>\n </MenuItem>\n ))}\n </MenuGroup>\n <MenuDivider />\n <MenuItem\n disabled={!currentAuthenticated}\n onClick={() => {\n if (states.shortcuts.length >= SHORTCUTS_LIMIT) {\n alert(\n plural(SHORTCUTS_LIMIT, {\n one: 'Max # shortcut reached. Unable to add shortcut.',\n other: 'Max # shortcuts reached. Unable to add shortcut.',\n }),\n );\n return;\n }\n const shortcut = {\n type: 'hashtag',\n hashtag: hashtags.join(' '),\n instance,\n media: media ? 'on' : undefined,\n };\n // Check if already exists\n const exists = states.shortcuts.some(\n (s) =>\n s.type === shortcut.type &&\n s.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') ===\n shortcut.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') &&\n (s.instance ? s.instance === shortcut.instance : true) &&\n (s.media ? !!s.media === !!shortcut.media : true),\n );\n if (exists) {\n alert(t`This shortcut already exists`);\n } else {\n states.shortcuts.push(shortcut);\n showToast(t`Hashtag shortcut added`);\n }\n }}\n >\n <Icon icon=\"shortcut\" />{' '}\n <span>\n <Trans>Add to Shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/t/${hashtags.join('+')}`);\n location.hash = `/${newInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Hashtags;\n","import './lists.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport { getList, getLists } from '../utils/lists';\nimport states, { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction List(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance } = api();\n const id = props?.id || useParams()?.id;\n // const navigate = useNavigate();\n const latestItem = useRef();\n // const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n const listIterator = useRef();\n async function fetchList(firstLoad) {\n if (firstLoad || !listIterator.current) {\n listIterator.current = masto.v1.timelines.list.$select(id).list({\n limit: LIMIT,\n });\n }\n const results = await listIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.list.$select(id).list({\n limit: 1,\n since_id: latestItem.current,\n });\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'home');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [lists, setLists] = useState([]);\n useEffect(() => {\n getLists().then(setLists);\n }, []);\n\n const [list, setList] = useState({ title: 'List' });\n // const [title, setTitle] = useState(`List`);\n useTitle(list.title, `/l/:id`);\n useEffect(() => {\n (async () => {\n try {\n const list = await getList(id);\n setList(list);\n // setTitle(list.title);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [id]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n const [showManageMembersModal, setShowManageMembersModal] = useState(false);\n\n return (\n <>\n <Timeline\n key={id}\n title={list.title}\n id=\"list\"\n emptyText={t`Nothing yet.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchList}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"home\"\n showReplyParent\n // refresh={reloadCount}\n headerStart={\n // <Link to=\"/l\" class=\"button plain\">\n // <Icon icon=\"list\" size=\"l\" />\n // </Link>\n <Menu2\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"list\" size=\"l\" alt={t`Lists`} />\n <Icon icon=\"chevron-down\" size=\"s\" />\n </button>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </Menu2>\n }\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() =>\n setShowListAddEditModal({\n list,\n })\n }\n >\n <Icon icon=\"pencil\" size=\"l\" />\n <span>\n <Trans>Edit</Trans>\n </span>\n </MenuItem>\n <MenuItem onClick={() => setShowManageMembersModal(true)}>\n <Icon icon=\"group\" size=\"l\" />\n <span>\n <Trans>Manage members</Trans>\n </span>\n </MenuItem>\n </Menu2>\n }\n />\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success' && result.list) {\n setList(result.list);\n // reload();\n } else if (result.state === 'deleted') {\n // navigate('/l');\n location.hash = '/l';\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n {showManageMembersModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowManageMembersModal(false);\n }\n }}\n >\n <ListManageMembers\n listID={id}\n onClose={() => setShowManageMembersModal(false)}\n />\n </Modal>\n )}\n </>\n );\n}\n\nconst MEMBERS_LIMIT = 40;\nfunction ListManageMembers({ listID, onClose }) {\n // Show list of members with [Remove] button\n // API only returns 40 members at a time, so this need to be paginated with infinite scroll\n // Show [Add] button after removing a member\n const { masto, instance } = api();\n const [members, setMembers] = useState([]);\n const [uiState, setUIState] = useState('default');\n const [showMore, setShowMore] = useState(false);\n\n const membersIterator = useRef();\n\n async function fetchMembers(firstLoad) {\n setShowMore(false);\n setUIState('loading');\n (async () => {\n try {\n if (firstLoad || !membersIterator.current) {\n membersIterator.current = masto.v1.lists\n .$select(listID)\n .accounts.list({\n limit: MEMBERS_LIMIT,\n });\n }\n const results = await membersIterator.current.next();\n let { done, value } = results;\n if (value?.length) {\n if (firstLoad) {\n setMembers(value);\n } else {\n setMembers(members.concat(value));\n }\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n fetchMembers(true);\n }, []);\n\n return (\n <div class=\"sheet\" id=\"list-manage-members-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Manage members</Trans>\n </h2>\n </header>\n <main>\n <ul>\n {members.map((member) => (\n <li key={member.id}>\n <AccountBlock account={member} instance={instance} />\n <RemoveAddButton account={member} listID={listID} />\n </li>\n ))}\n {showMore && uiState === 'default' && (\n <InView as=\"li\" onChange={(inView) => inView && fetchMembers()}>\n <button type=\"button\" class=\"light block\" onClick={fetchMembers}>\n <Trans>Show more…</Trans>\n </button>\n </InView>\n )}\n </ul>\n </main>\n </div>\n );\n}\n\nfunction RemoveAddButton({ account, listID }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [removed, setRemoved] = useState(false);\n\n return (\n <MenuConfirm\n confirm={!removed}\n confirmLabel={\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{account.username}</span> from\n list?\n </Trans>\n </span>\n }\n align=\"end\"\n menuItemClassName=\"danger\"\n onClick={() => {\n if (removed) {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.create({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(false);\n } catch (e) {\n setUIState('error');\n }\n })();\n } else {\n // const yes = confirm(`Remove ${account.username} from this list?`);\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.remove({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(true);\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n }}\n >\n <button\n type=\"button\"\n class={`light ${removed ? '' : 'danger'}`}\n disabled={uiState === 'loading'}\n >\n {removed ? t`Add` : t`Remove…`}\n </button>\n </MenuConfirm>\n );\n}\n\nexport default List;\n","// This is like very lame \"type-checking\" lol\nconst notificationTypeKeys = {\n mention: ['account', 'status'],\n status: ['account', 'status'],\n reblog: ['account', 'status'],\n follow: ['account'],\n follow_request: ['account'],\n favourite: ['account', 'status'],\n poll: ['status'],\n update: ['status'],\n};\n\nconst GROUP_TYPES = ['favourite', 'reblog', 'follow'];\nconst groupable = (type) => GROUP_TYPES.includes(type);\n\nexport function fixNotifications(notifications) {\n return notifications.filter((notification) => {\n const { type, id, createdAt } = notification;\n if (!type) {\n console.warn('Notification missing type', notification);\n return false;\n }\n if (!id || !createdAt) {\n console.warn('Notification missing id or createdAt', notification);\n // Continue processing this despite missing id or createdAt\n }\n const keys = notificationTypeKeys[type];\n if (keys?.length) {\n return keys.every((key) => !!notification[key]);\n }\n return true; // skip other types\n });\n}\n\nexport function massageNotifications2(notifications) {\n if (notifications?.notificationGroups) {\n const {\n accounts = [],\n notificationGroups = [],\n statuses = [],\n } = notifications;\n return notificationGroups.map((group) => {\n const { sampleAccountIds, statusId } = group;\n const sampleAccounts =\n sampleAccountIds?.map((id) => accounts.find((a) => a.id === id)) || [];\n const status = statuses?.find((s) => s.id === statusId) || null;\n return {\n ...group,\n sampleAccounts,\n status,\n };\n });\n }\n return notifications;\n}\n\nexport function groupNotifications2(groupNotifications) {\n // Make grouped notifications to look like faux grouped notifications\n const newGroupNotifications = groupNotifications.map((gn) => {\n const {\n latestPageNotificationAt,\n mostRecentNotificationId,\n sampleAccounts,\n notificationsCount,\n } = gn;\n\n return {\n id: '' + mostRecentNotificationId,\n createdAt: latestPageNotificationAt,\n account: sampleAccounts[0],\n ...gn,\n };\n });\n\n // Merge favourited and reblogged of same status into a single notification\n // - new type: \"favourite+reblog\"\n // - sum numbers for `notificationsCount` and `sampleAccounts`\n const notificationsMap = {};\n const newGroupNotifications1 = [];\n for (let i = 0; i < newGroupNotifications.length; i++) {\n const gn = newGroupNotifications[i];\n const {\n type,\n status,\n createdAt,\n notificationsCount,\n sampleAccounts,\n groupKey,\n } = gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n // const sameCount =\n notificationsCount > 0 && notificationsCount === sampleAccounts?.length;\n // if (sameCount && (type === 'favourite' || type === 'reblog')) {\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n // const key = `${status?.id}-${virtualType}-${date}-${sameCount ? 1 : 0}`;\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (!groupable(type)) {\n newGroupNotifications1.push(gn);\n } else if (mappedNotification) {\n // Merge sampleAccounts + merge _types\n sampleAccounts.forEach((a) => {\n const mappedAccount = mappedNotification.sampleAccounts.find(\n (ma) => ma.id === a.id,\n );\n if (!mappedAccount) {\n mappedNotification.sampleAccounts.push({\n ...a,\n _types: [type],\n });\n } else {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n }\n });\n // mappedNotification.notificationsCount =\n // mappedNotification.sampleAccounts.length;\n mappedNotification.notificationsCount = Math.min(\n mappedNotification.notificationsCount,\n notificationsCount,\n );\n mappedNotification._notificationsCount.push(notificationsCount);\n mappedNotification._accounts = mappedNotification.sampleAccounts;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n const accounts = sampleAccounts.map((a) => ({\n ...a,\n _types: [type],\n }));\n notificationsMap[key] = {\n ...gn,\n sampleAccounts: accounts,\n type: virtualType,\n _accounts: accounts,\n _groupKeys: groupKey ? [groupKey] : [],\n _notificationsCount: [notificationsCount],\n };\n newGroupNotifications1.push(notificationsMap[key]);\n }\n }\n\n // 2nd pass.\n // - Group 1 account favourte/reblog multiple posts\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const newGroupNotifications2 = [];\n for (let i = 0; i < newGroupNotifications1.length; i++) {\n const gn = newGroupNotifications1[i];\n const { type, account, _accounts, sampleAccounts, createdAt, groupKey } =\n gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n const hasOneAccount =\n sampleAccounts?.length === 1 || _accounts?.length === 1;\n if (\n (type === 'favourite' ||\n type === 'reblog' ||\n type === 'favourite+reblog') &&\n hasOneAccount\n ) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(gn.status);\n mappedNotification._ids += `-${gn.id}`;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n let n = (notificationsMap2[key] = {\n ...gn,\n type,\n _ids: gn.id,\n _statuses: [gn.status],\n _groupKeys: groupKey ? [groupKey] : [],\n });\n newGroupNotifications2.push(n);\n }\n } else {\n newGroupNotifications2.push(gn);\n }\n }\n\n console.log('newGroupNotifications2', newGroupNotifications2);\n\n return newGroupNotifications2;\n}\n\nexport default function groupNotifications(notifications) {\n // Filter out invalid notifications\n notifications = fixNotifications(notifications);\n\n // Create new flat list of notifications\n // Combine sibling notifications based on type and status id\n // Concat all notification.account into an array of _accounts\n const notificationsMap = {};\n const cleanNotifications = [];\n for (let i = 0, j = 0; i < notifications.length; i++) {\n const notification = notifications[i];\n const { id, status, account, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (!groupable(type)) {\n cleanNotifications[j++] = notification;\n } else if (mappedNotification?.account) {\n const mappedAccount = mappedNotification._accounts.find(\n (a) => a.id === account.id,\n );\n if (mappedAccount) {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n mappedNotification._ids += `-${id}`;\n } else {\n account._types = [type];\n mappedNotification._accounts.push(account);\n mappedNotification._ids += `-${id}`;\n }\n } else {\n if (account) account._types = [type];\n let n = (notificationsMap[key] = {\n ...notification,\n type: virtualType,\n _ids: id,\n _accounts: account ? [account] : [],\n });\n cleanNotifications[j++] = n;\n }\n }\n\n // 2nd pass to group \"favourite+reblog\"-type notifications by account if _accounts.length <= 1\n // This means one acount has favourited and reblogged the multiple statuses\n // The grouped notification\n // - type: \"favourite+reblog+account\"\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const cleanNotifications2 = [];\n for (let i = 0, j = 0; i < cleanNotifications.length; i++) {\n const notification = cleanNotifications[i];\n const { id, account, _accounts, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n if (type === 'favourite+reblog' && account && _accounts.length === 1) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(notification.status);\n mappedNotification._ids += `-${id}`;\n } else {\n let n = (notificationsMap2[key] = {\n ...notification,\n type,\n _ids: id,\n _statuses: [notification.status],\n });\n cleanNotifications2[j++] = n;\n }\n } else {\n cleanNotifications2[j++] = notification;\n }\n }\n\n console.log({ notifications, cleanNotifications, cleanNotifications2 });\n\n // return cleanNotifications;\n return cleanNotifications2;\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useMemo, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { fixNotifications } from '../utils/group-notifications';\nimport { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nfunction Mentions({ columnMode, ...props }) {\n const { masto, instance } = api();\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const [stateType, setStateType] = useState(null);\n const type = props?.type || searchParams.get('type') || stateType;\n useTitle(type === 'private' ? t`Private mentions` : t`Mentions`, '/mentions');\n\n const mentionsIterator = useRef();\n const latestItem = useRef();\n\n async function fetchMentions(firstLoad) {\n if (firstLoad || !mentionsIterator.current) {\n mentionsIterator.current = masto.v1.notifications.list({\n limit: LIMIT,\n types: ['mention'],\n });\n }\n const results = await mentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = fixNotifications(value);\n\n if (firstLoad) {\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n value.forEach(({ status: item }) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value: value?.map((item) => item.status),\n };\n }\n\n const conversationsIterator = useRef();\n const latestConversationItem = useRef();\n async function fetchConversations(firstLoad) {\n if (firstLoad || !conversationsIterator.current) {\n conversationsIterator.current = masto.v1.conversations.list({\n limit: LIMIT,\n });\n }\n const results = await conversationsIterator.current.next();\n let { value } = results;\n value = value?.filter((item) => item.lastStatus);\n if (value?.length) {\n if (firstLoad) {\n latestConversationItem.current = value[0].lastStatus.id;\n console.log('First load', latestConversationItem.current);\n }\n\n value.forEach(({ lastStatus: item }) => {\n saveStatus(item, instance);\n });\n }\n console.log('results', results);\n return {\n ...results,\n value: value?.map((item) => item.lastStatus),\n };\n }\n\n function fetchItems(...args) {\n if (type === 'private') {\n return fetchConversations(...args);\n }\n return fetchMentions(...args);\n }\n\n async function checkForUpdates() {\n if (type === 'private') {\n try {\n const results = await masto.v1.conversations\n .list({\n limit: 1,\n since_id: latestConversationItem.current,\n })\n .next();\n let { value } = results;\n console.log(\n 'checkForUpdates PRIVATE',\n latestConversationItem.current,\n value,\n );\n const valueContainsLatestItem =\n value[0]?.id === latestConversationItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestConversationItem.current = value[0].lastStatus.id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n } else {\n try {\n const results = await masto.v1.notifications\n .list({\n limit: 1,\n types: ['mention'],\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n console.log('checkForUpdates ALL', latestItem.current, value);\n if (value?.length) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <div class=\"filter-bar centered\">\n <Link\n to=\"/mentions\"\n class={!type ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType(null);\n }\n }}\n >\n <Trans>All</Trans>\n </Link>\n <Link\n to=\"/mentions?type=private\"\n class={type === 'private' ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType('private');\n }\n }}\n >\n <Trans>Private</Trans>\n </Link>\n </div>\n );\n }, [type]);\n\n return (\n <Timeline\n title={t`Mentions`}\n id=\"mentions\"\n emptyText={t`No one mentioned you :(`}\n errorText={t`Unable to load mentions.`}\n instance={instance}\n fetchItems={fetchItems}\n checkForUpdates={checkForUpdates}\n useItemID\n timelineStart={TimelineStart}\n refresh={type}\n />\n );\n}\n\nexport default Mentions;\n","import './notifications.css';\n\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } 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 { InView } from 'react-intersection-observer';\nimport { useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\nimport { subscribeKey } from 'valtio/utils';\n\nimport AccountBlock from '../components/account-block';\nimport FollowRequestButtons from '../components/follow-request-buttons';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport Notification from '../components/notification';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport groupNotifications, {\n groupNotifications2,\n massageNotifications2,\n} from '../utils/group-notifications';\nimport handleContentLinks from '../utils/handle-content-links';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport { getRegistration } from '../utils/push-notifications';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { getCurrentInstance } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nconst NOTIFICATIONS_LIMIT = 80;\nconst NOTIFICATIONS_GROUPED_LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nconst scrollIntoViewOptions = {\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n};\n\nconst memSupportsGroupedNotifications = mem(\n () => supports('@mastodon/grouped-notifications'),\n {\n maxAge: 1000 * 60 * 5, // 5 minutes\n },\n);\n\nexport function mastoFetchNotifications(opts = {}) {\n const { masto } = api();\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n // https://github.com/mastodon/mastodon/pull/29889\n return masto.v2.notifications.list({\n limit: NOTIFICATIONS_GROUPED_LIMIT,\n ...opts,\n });\n } else {\n return masto.v1.notifications.list({\n limit: NOTIFICATIONS_LIMIT,\n ...opts,\n });\n }\n}\n\nexport function getGroupedNotifications(notifications) {\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n return groupNotifications2(notifications);\n } else {\n return groupNotifications(notifications);\n }\n}\n\nconst NOTIFICATIONS_POLICIES = [\n 'forNotFollowing',\n 'forNotFollowers',\n 'forNewAccounts',\n 'forPrivateMentions',\n 'forLimitedAccounts',\n];\nconst NOTIFICATIONS_POLICIES_TEXT = {\n forNotFollowing: msg`You don't follow`,\n forNotFollowers: msg`Who don't follow you`,\n forNewAccounts: msg`With a new account`,\n forPrivateMentions: msg`Who unsolicitedly private mention you`,\n forLimitedAccounts: msg`Who are limited by server moderators`,\n};\n\nfunction Notifications({ columnMode }) {\n const { _ } = useLingui();\n useTitle(t`Notifications`, '/notifications');\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const notificationID = searchParams.get('id');\n const notificationAccessToken = searchParams.get('access_token');\n const [showMore, setShowMore] = useState(false);\n const [onlyMentions, setOnlyMentions] = useState(false);\n const scrollableRef = useRef();\n const { nearReachEnd, scrollDirection, reachStart, nearReachStart } =\n useScroll({\n scrollableRef,\n });\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n const [followRequests, setFollowRequests] = useState([]);\n const [announcements, setAnnouncements] = useState([]);\n\n console.debug('RENDER Notifications');\n\n const notificationsIterator = useRef();\n async function fetchNotifications(firstLoad) {\n if (firstLoad || !notificationsIterator.current) {\n // Reset iterator\n notificationsIterator.current = mastoFetchNotifications({\n excludeTypes: ['follow_request'],\n });\n }\n if (/max_id=($|&)/i.test(notificationsIterator.current?.nextParams)) {\n // Pixelfed returns next paginationed link with empty max_id\n // I assume, it's done (end of list)\n return {\n done: true,\n };\n }\n const allNotifications = await notificationsIterator.current.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n // TEST: Slot in a fake notification to test 'severed_relationships'\n // notifications.unshift({\n // id: '123123',\n // type: 'severed_relationships',\n // createdAt: '2024-03-22T19:20:08.316Z',\n // event: {\n // type: 'account_suspension',\n // targetName: 'mastodon.dev',\n // followersCount: 0,\n // followingCount: 0,\n // },\n // });\n\n // TEST: Slot in a fake notification to test 'moderation_warning'\n // notifications.unshift({\n // id: '123123',\n // type: 'moderation_warning',\n // createdAt: new Date().toISOString(),\n // moderation_warning: {\n // id: '1231234',\n // action: 'mark_statuses_as_sensitive',\n // },\n // });\n\n // console.log({ notifications });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n if (firstLoad) {\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n } else {\n states.notifications.push(...groupedNotifications);\n }\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n async function fetchFollowRequests() {\n // Note: no pagination here yet because this better be on a separate page. Should be rare use-case???\n try {\n return await masto.v1.followRequests.list({\n limit: 80,\n });\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const loadFollowRequests = () => {\n setUIState('loading');\n (async () => {\n try {\n const requests = await fetchFollowRequests();\n setFollowRequests(requests);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n };\n\n async function fetchAnnouncements() {\n try {\n return await masto.v1.announcements.list();\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const supportsFilteredNotifications = supports(\n '@mastodon/filtered-notifications',\n );\n const [showNotificationsSettings, setShowNotificationsSettings] =\n useState(false);\n const [notificationsPolicy, setNotificationsPolicy] = useState({});\n function fetchNotificationsPolicy() {\n return masto.v2.notifications.policy.fetch().catch(() => {});\n }\n function loadNotificationsPolicy() {\n fetchNotificationsPolicy()\n .then((policy) => {\n console.log('✨ Notifications policy', policy);\n setNotificationsPolicy(policy);\n })\n .catch(() => {});\n }\n const [notificationsRequests, setNotificationsRequests] = useState(null);\n function fetchNotificationsRequest() {\n return masto.v1.notifications.requests.list();\n }\n\n const loadNotifications = (firstLoad) => {\n setShowNew(false);\n setUIState('loading');\n (async () => {\n try {\n const fetchNotificationsPromise = fetchNotifications(firstLoad);\n\n if (firstLoad) {\n fetchAnnouncements()\n .then((announcements) => {\n announcements.sort((a, b) => {\n // Sort by updatedAt first, then createdAt\n const aDate = new Date(a.updatedAt || a.createdAt);\n const bDate = new Date(b.updatedAt || b.createdAt);\n return bDate - aDate;\n });\n setAnnouncements(announcements);\n })\n .catch(() => {});\n\n fetchFollowRequests()\n .then((requests) => {\n setFollowRequests(requests);\n })\n .catch(() => {});\n\n if (supportsFilteredNotifications) {\n loadNotificationsPolicy();\n }\n }\n\n const { done } = await fetchNotificationsPromise;\n setShowMore(!done);\n\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n useEffect(() => {\n loadNotifications(true);\n }, []);\n useEffect(() => {\n if (reachStart) {\n loadNotifications(true);\n }\n }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd && showMore) {\n // loadNotifications();\n // }\n // }, [nearReachEnd, showMore]);\n\n const [showNew, setShowNew] = useState(false);\n\n const loadUpdates = useCallback(\n ({ disableIdleCheck = false } = {}) => {\n if (uiState === 'loading') {\n return;\n }\n console.log('✨ Load updates', {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current?.scrollTop,\n inBackground: inBackground(),\n disableIdleCheck,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current?.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground()\n ) {\n loadNotifications(true);\n }\n },\n [snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState],\n );\n // useEffect(loadUpdates, [snapStates.notificationsShowNew]);\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadUpdates({\n disableIdleCheck: true,\n });\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n const firstLoad = useRef(true);\n useEffect(() => {\n let unsub = subscribeKey(states, 'notificationsShowNew', (v) => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (uiState === 'loading') return;\n if (v) loadUpdates();\n setShowNew(v);\n });\n return () => unsub?.();\n }, []);\n\n const todayDate = new Date();\n const yesterdayDate = new Date(todayDate - 24 * 60 * 60 * 1000);\n let currentDay = new Date();\n const showTodayEmpty = !snapStates.notifications.some(\n (notification) =>\n new Date(notification.createdAt).toDateString() ===\n todayDate.toDateString(),\n );\n\n const announcementsListRef = useRef();\n\n useEffect(() => {\n if (notificationID) {\n states.routeNotification = {\n id: notificationID,\n accessToken: atob(notificationAccessToken),\n };\n }\n }, [notificationID, notificationAccessToken]);\n\n // useEffect(() => {\n // if (uiState === 'default') {\n // (async () => {\n // try {\n // const registration = await getRegistration();\n // if (registration?.getNotifications) {\n // const notifications = await registration.getNotifications();\n // console.log('🔔 Push notifications', notifications);\n // // Close all notifications?\n // // notifications.forEach((notification) => {\n // // notification.close();\n // // });\n // }\n // } catch (e) {}\n // })();\n // }\n // }, [uiState]);\n\n const itemsSelector = '.notification';\n const jRef = useHotkeys('j', () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k', () => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const statusLink = activeItem?.querySelector('.status-link');\n if (statusLink) {\n statusLink.click();\n }\n });\n\n const today = new Date();\n const todaySubHeading = useMemo(() => {\n return niceDateTime(today, {\n forceOpts: {\n weekday: 'long',\n },\n });\n }, [today]);\n\n return (\n <div\n id=\"notifications-page\"\n class=\"deck-container\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n }}\n tabIndex=\"-1\"\n >\n <div class={`timeline-deck deck ${onlyMentions ? 'only-mentions' : ''}`}>\n <header\n hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({ top: 0, behavior: 'smooth' });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadNotifications(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Notifications</Trans>\n </h1>\n <div class=\"header-side\">\n {supportsFilteredNotifications && (\n <button\n type=\"button\"\n class=\"button plain4\"\n onClick={() => {\n setShowNotificationsSettings(true);\n }}\n >\n <Icon\n icon=\"settings\"\n size=\"l\"\n alt={t`Notifications settings`}\n />\n </button>\n )}\n </div>\n </div>\n {showNew && uiState !== 'loading' && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={() => {\n loadNotifications(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New notifications</Trans>\n </button>\n )}\n </header>\n {announcements.length > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <details class=\"announcements\">\n <summary>\n <span>\n <Icon icon=\"announce\" class=\"announcement-icon\" size=\"l\" />{' '}\n <Plural\n value={announcements.length}\n one=\"Announcement\"\n other=\"Announcements\"\n />{' '}\n <small class=\"insignificant\">{instance}</small>\n </span>\n {announcements.length > 1 && (\n <span class=\"announcements-nav-buttons\">\n {announcements.map((announcement, index) => (\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n announcementsListRef.current?.children[\n index\n ].scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }}\n >\n {index + 1}\n </button>\n ))}\n </span>\n )}\n </summary>\n <ul\n class={`announcements-list-${\n announcements.length > 1 ? 'multiple' : 'single'\n }`}\n ref={announcementsListRef}\n >\n {announcements.map((announcement) => (\n <li>\n <AnnouncementBlock announcement={announcement} />\n </li>\n ))}\n </ul>\n </details>\n </div>\n </div>\n )}\n {followRequests.length > 0 && (\n <div class=\"follow-requests\">\n <h2 class=\"timeline-header\">\n <Trans>Follow requests</Trans>\n </h2>\n {followRequests.length > 5 ? (\n <details>\n <summary>\n <Plural\n value={followRequests.length}\n one=\"# follow request\"\n other=\"# follow requests\"\n />\n </summary>\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n </details>\n ) : (\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n {supportsFilteredNotifications &&\n notificationsPolicy?.summary?.pendingRequestsCount > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <div class=\"filtered-notifications\">\n <details\n onToggle={async (e) => {\n const { open } = e.target;\n if (open) {\n const requests = await fetchNotificationsRequest();\n setNotificationsRequests(requests);\n console.log({ open, requests });\n }\n }}\n >\n <summary>\n <Plural\n value={notificationsPolicy.summary.pendingRequestsCount}\n one=\"Filtered notifications from # person\"\n other=\"Filtered notifications from # people\"\n />\n </summary>\n {!notificationsRequests ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notificationsRequests?.length > 0 && (\n <ul>\n {notificationsRequests.map((request) => (\n <li key={request.id}>\n <div class=\"request-notifcations\">\n {!request.lastStatus?.id && (\n <AccountBlock\n useAvatarStatic\n showStats\n account={request.account}\n />\n )}\n {request.lastStatus?.id && (\n <div class=\"last-post\">\n <Link\n class=\"status-link\"\n to={`/${instance}/s/${request.lastStatus.id}`}\n >\n <Status\n status={request.lastStatus}\n size=\"s\"\n readOnly\n />\n </Link>\n </div>\n )}\n <NotificationRequestModalButton\n request={request}\n />\n </div>\n <NotificationRequestButtons\n request={request}\n onChange={() => {\n loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )\n )}\n </details>\n </div>\n </div>\n </div>\n )}\n <div id=\"mentions-option\">\n <label>\n <input\n type=\"checkbox\"\n checked={onlyMentions}\n onChange={(e) => {\n setOnlyMentions(e.target.checked);\n }}\n />{' '}\n <Trans>Only mentions</Trans>\n </label>\n </div>\n <h2 class=\"timeline-header\">\n <Trans>Today</Trans>{' '}\n <small class=\"insignificant bidi-isolate\">{todaySubHeading}</small>\n </h2>\n {showTodayEmpty && (\n <p class=\"ui-state insignificant\">\n {uiState === 'default' ? t`You're all caught up.` : <>&hellip;</>}\n </p>\n )}\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n // This is leaked from Notifications popover\n .filter((n) => n.type !== 'follow_request')\n .map((notification) => {\n if (onlyMentions && notification.type !== 'mention') {\n return null;\n }\n const notificationDay = new Date(notification.createdAt);\n const differentDay =\n notificationDay.toDateString() !== currentDay.toDateString();\n if (differentDay) {\n currentDay = notificationDay;\n }\n // if notificationDay is yesterday, show \"Yesterday\"\n // if notificationDay is before yesterday, show date\n const heading =\n notificationDay.toDateString() ===\n yesterdayDate.toDateString()\n ? t`Yesterday`\n : niceDateTime(currentDay, {\n hideTime: true,\n });\n const subHeading = niceDateTime(currentDay, {\n forceOpts: {\n weekday: 'long',\n },\n });\n return (\n <Fragment key={notification._ids || notification.id}>\n {differentDay && (\n <h2 class=\"timeline-header\">\n <span>{heading}</span>{' '}\n <small class=\"insignificant bidi-isolate\">\n {subHeading}\n </small>\n </h2>\n )}\n <Notification\n instance={instance}\n notification={notification}\n key={notification._ids || notification.id}\n />\n </Fragment>\n );\n })}\n </>\n ) : (\n <>\n {uiState === 'loading' && (\n <>\n <ul class=\"timeline flat\">\n {Array.from({ length: 5 }).map((_, i) => (\n <li class=\"notification skeleton\">\n <div class=\"notification-type\">\n <Icon icon=\"notification\" size=\"xl\" />\n </div>\n <div class=\"notification-content\">\n <p>███████████ ████</p>\n </div>\n </li>\n ))}\n </ul>\n </>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load notifications</Trans>\n <br />\n <br />\n <button type=\"button\" onClick={() => loadNotifications(true)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n {showMore && (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadNotifications();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n disabled={uiState === 'loading'}\n onClick={() => loadNotifications()}\n style={{ marginBlockEnd: '6em' }}\n >\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : (\n <Trans>Show more…</Trans>\n )}\n </button>\n </InView>\n )}\n </div>\n {supportsFilteredNotifications && showNotificationsSettings && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowNotificationsSettings(false);\n }\n }}\n >\n <div class=\"sheet\" id=\"notifications-settings\" tabIndex=\"-1\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowNotificationsSettings(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Notifications settings</Trans>\n </h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const {\n forNotFollowing,\n forNotFollowers,\n forNewAccounts,\n forPrivateMentions,\n forLimitedAccounts,\n } = e.target;\n const newPolicy = {\n ...notificationsPolicy,\n forNotFollowing: forNotFollowing.value,\n forNotFollowers: forNotFollowers.value,\n forNewAccounts: forNewAccounts.value,\n forPrivateMentions: forPrivateMentions.value,\n forLimitedAccounts: forLimitedAccounts.value,\n };\n setNotificationsPolicy(newPolicy);\n setShowNotificationsSettings(false);\n (async () => {\n try {\n await masto.v2.notifications.policy.update(newPolicy);\n showToast(t`Notifications settings updated`);\n } catch (e) {\n console.error(e);\n }\n })();\n }}\n >\n <p>\n <Trans>Filter out notifications from people:</Trans>\n </p>\n <div class=\"notification-policy-fields\">\n {NOTIFICATIONS_POLICIES.map((key) => {\n const value = notificationsPolicy[key];\n return (\n <div key={key}>\n <label>\n {_(NOTIFICATIONS_POLICIES_TEXT[key])}\n <select name={key} defaultValue={value} class=\"small\">\n <option value=\"accept\">\n <Trans>Accept</Trans>\n </option>\n <option value=\"filter\">\n <Trans>Filter</Trans>\n </option>\n <option value=\"drop\">\n <Trans>Ignore</Trans>\n </option>\n </select>\n </label>\n </div>\n );\n })}\n </div>\n <p>\n <button type=\"submit\">\n <Trans>Save</Trans>\n </button>\n </p>\n </form>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nfunction AnnouncementBlock({ announcement }) {\n const { instance } = api();\n const { contact } = getCurrentInstance();\n const contactAccount = contact?.account;\n const {\n id,\n content,\n startsAt,\n endsAt,\n published,\n allDay,\n publishedAt,\n updatedAt,\n read,\n mentions,\n statuses,\n tags,\n emojis,\n reactions,\n } = announcement;\n\n const publishedAtDate = new Date(publishedAt);\n const publishedDateText = niceDateTime(publishedAtDate);\n const updatedAtDate = new Date(updatedAt);\n const updatedAtText = niceDateTime(updatedAtDate);\n\n return (\n <div class=\"announcement-block\">\n <AccountBlock account={contactAccount} />\n <div\n class=\"announcement-content\"\n onClick={handleContentLinks({ mentions, instance })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(content, {\n emojis,\n }),\n }}\n />\n <p class=\"insignificant\">\n <time datetime={publishedAtDate.toISOString()}>\n {niceDateTime(publishedAtDate)}\n </time>\n {updatedAt && updatedAtText !== publishedDateText && (\n <>\n {' '}\n &bull;{' '}\n <span class=\"ib\">\n <Trans>\n Updated{' '}\n <time datetime={updatedAtDate.toISOString()}>\n {niceDateTime(updatedAtDate)}\n </time>\n </Trans>\n </span>\n </>\n )}\n </p>\n <div class=\"announcement-reactions\" hidden>\n {reactions.map((reaction) => {\n const { name, count, me, staticUrl, url } = reaction;\n return (\n <button type=\"button\" class={`plain4 small ${me ? 'reacted' : ''}`}>\n {url || staticUrl ? (\n <img src={url || staticUrl} alt={name} width=\"16\" height=\"16\" />\n ) : (\n <span>{name}</span>\n )}{' '}\n <span class=\"count\">{shortenNumber(count)}</span>\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction fetchNotficationsByAccount(accountID) {\n const { masto } = api();\n return masto.v1.notifications.list({\n accountID,\n });\n}\nfunction NotificationRequestModalButton({ request }) {\n const { instance } = api();\n const [uiState, setUIState] = useState('loading');\n const { account, lastStatus } = request;\n const [showModal, setShowModal] = useState(false);\n const [notifications, setNotifications] = useState([]);\n\n function onClose() {\n setShowModal(false);\n }\n\n useEffect(() => {\n if (!request?.account?.id) return;\n if (!showModal) return;\n setUIState('loading');\n (async () => {\n const notifs = await fetchNotficationsByAccount(request.account.id);\n setNotifications(notifs || []);\n setUIState('default');\n })();\n }, [showModal, request?.account?.id]);\n\n return (\n <>\n <button\n type=\"button\"\n class=\"plain4 request-notifications-account\"\n onClick={() => {\n setShowModal(true);\n }}\n >\n <Icon icon=\"notification\" class=\"more-insignificant\" />{' '}\n <small>\n <Trans>\n View notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </small>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n {showModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>\n Notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notifications.map((notification) => (\n <div\n class=\"notification-peek\"\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (\n e.target.tagName === 'BUTTON' ||\n e.target.tagName === 'A'\n ) {\n onClose();\n }\n }}\n >\n <Notification\n instance={instance}\n notification={notification}\n isStatic\n />\n </div>\n ))\n )}\n </main>\n </div>\n </Modal>\n )}\n </>\n );\n}\n\nfunction NotificationRequestButtons({ request, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, dismiss\n const hasRequestState = requestState !== null;\n\n return (\n <p class=\"notification-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .accept();\n setRequestState('accept');\n setUIState('default');\n onChange({\n request,\n state: 'accept',\n });\n showToast(\n t`Notifications from @${request.account.username} will not be filtered from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to accept notification request`);\n }\n })();\n }}\n >\n <Trans>Allow</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .dismiss();\n setRequestState('dismiss');\n setUIState('default');\n onChange({\n request,\n state: 'dismiss',\n });\n showToast(\n t`Notifications from @${request.account.username} will not show up in Filtered notifications from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to dismiss notification request`);\n }\n })();\n }}\n >\n <Trans>Dismiss</Trans>\n </button>\n <span class=\"notification-request-states\">\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"notification-accepted\"\n />\n ) : (\n requestState === 'dismiss' && (\n <Icon\n icon=\"x-circle\"\n alt={t`Dismissed`}\n class=\"notification-dismissed\"\n />\n )\n )}\n </span>\n </p>\n );\n}\n\nexport default memo(Notifications);\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Public({ local, columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const isLocal = !!local;\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = isLocal\n ? t`Local timeline (${instance})`\n : t`Federated timeline (${instance})`;\n useTitle(title, isLocal ? `/:instance?/p/l` : `/:instance?/p`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const publicIterator = useRef();\n async function fetchPublic(firstLoad) {\n if (firstLoad || !publicIterator.current) {\n const opts = {\n limit: LIMIT,\n local: isLocal || undefined,\n };\n if (!isLocal && supports('@pixelfed/global-feed')) {\n opts.remote = true;\n }\n publicIterator.current = masto.v1.timelines.public.list(opts);\n }\n const results = await publicIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.public\n .list({\n limit: 1,\n local: isLocal,\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n return (\n <Timeline\n key={instance + isLocal}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>{isLocal ? t`Local timeline` : t`Federated timeline`}</b>\n <div>{instance}</div>\n </h1>\n }\n id=\"public\"\n instance={instance}\n emptyText={t`No one has posted anything yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchPublic}\n checkForUpdates={checkForUpdates}\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem href={isLocal ? `/#/${instance}/p` : `/#/${instance}/p/l`}>\n {isLocal ? (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Federated</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Local</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(isLocal ? `/${newInstance}/p/l` : `/${newInstance}/p`);\n location.hash = isLocal\n ? `/${newInstance}/p/l`\n : `/${newInstance}/p`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = isLocal\n ? `/${currentInstance}/p/l`\n : `/${currentInstance}/p`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Public;\n","import './search.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useParams, useSearchParams } from 'react-router-dom';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport SearchForm from '../components/search-form';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport shortenNumber from '../utils/shorten-number';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useTitle from '../utils/useTitle';\n\nconst SHORT_LIMIT = 5;\nconst LIMIT = 40;\nconst emptySearchParams = new URLSearchParams();\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Search({ columnMode, ...props }) {\n const params = columnMode ? {} : useParams();\n const { masto, instance, authenticated } = api({\n instance: params.instance,\n });\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const searchFormRef = useRef();\n const q = props?.query || searchParams.get('q');\n const type = columnMode\n ? 'statuses'\n : props?.type || searchParams.get('type');\n let title = t`Search`;\n if (q) {\n switch (type) {\n case 'statuses':\n title = t`Search: ${q} (Posts)`;\n break;\n case 'accounts':\n title = t`Search: ${q} (Accounts)`;\n break;\n case 'hashtags':\n title = t`Search: ${q} (Hashtags)`;\n break;\n default:\n title = t`Search: ${q}`;\n }\n }\n useTitle(title, `/search`);\n\n const [showMore, setShowMore] = useState(false);\n const offsetRef = useRef(0);\n useEffect(() => {\n offsetRef.current = 0;\n }, [q, type]);\n\n const scrollableRef = useRef();\n useLayoutEffect(() => {\n scrollableRef.current?.scrollTo?.(0, 0);\n }, [q, type]);\n\n const [statusResults, setStatusResults] = useState([]);\n const [accountResults, setAccountResults] = useState([]);\n const [hashtagResults, setHashtagResults] = useState([]);\n useEffect(() => {\n setStatusResults([]);\n setAccountResults([]);\n setHashtagResults([]);\n }, [q]);\n const setTypeResultsFunc = {\n statuses: setStatusResults,\n accounts: setAccountResults,\n hashtags: setHashtagResults,\n };\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\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 function loadResults(firstLoad) {\n if (firstLoad) {\n offsetRef.current = 0;\n }\n\n if (!firstLoad && !authenticated) {\n // Search results pagination is only available to authenticated users\n return;\n }\n\n setUIState('loading');\n if (firstLoad && !type) {\n setStatusResults(statusResults.slice(0, SHORT_LIMIT));\n setAccountResults(accountResults.slice(0, SHORT_LIMIT));\n setHashtagResults(hashtagResults.slice(0, SHORT_LIMIT));\n }\n\n (async () => {\n const params = {\n q,\n resolve: authenticated,\n limit: SHORT_LIMIT,\n };\n if (type) {\n params.limit = LIMIT;\n params.type = type;\n if (authenticated) params.offset = offsetRef.current;\n }\n\n try {\n const results = await masto.v2.search.fetch(params);\n console.log(results);\n if (type) {\n if (firstLoad) {\n setTypeResultsFunc[type](results[type]);\n const length = results[type]?.length;\n offsetRef.current = LIMIT;\n setShowMore(!!length);\n } else {\n setTypeResultsFunc[type]((prev) => [...prev, ...results[type]]);\n const length = results[type]?.length;\n offsetRef.current = offsetRef.current + LIMIT;\n setShowMore(!!length);\n }\n } else {\n setStatusResults(results.statuses || []);\n setAccountResults(results.accounts || []);\n setHashtagResults(results.hashtags || []);\n offsetRef.current = 0;\n setShowMore(false);\n }\n loadRelationships(results.accounts);\n\n setUIState('default');\n } catch (err) {\n console.error(err);\n setUIState('error');\n }\n })();\n }\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n const reachStart = scrollableRef.current?.scrollTop === 0;\n if (visible && reachStart) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadResults(true);\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n\n useEffect(() => {\n searchFormRef.current?.setValue?.(q || '');\n if (q) {\n loadResults(true);\n } else {\n searchFormRef.current?.focus?.();\n }\n }, [q, type, instance]);\n\n useHotkeys(\n ['/', 'Slash'],\n (e) => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n },\n {\n preventDefault: true,\n },\n );\n\n const itemsSelector = '.timeline > li > a, .hashtag-list > li > a';\n const jRef = useHotkeys('j', () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k', () => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const [filterBarParent] = useAutoAnimate();\n\n return (\n <div\n id=\"search-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n }}\n >\n <div class=\"timeline-deck deck\">\n <header class={uiState === 'loading' ? 'loading' : ''}>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n </div>\n <SearchForm ref={searchFormRef} />\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n loadResults(true);\n }}\n disabled={uiState === 'loading'}\n >\n <Icon icon=\"search\" size=\"l\" alt={t`Search`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {!!q && !columnMode && (\n <div\n ref={filterBarParent}\n class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {!!type && (\n <Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}>\n <Icon icon=\"chevron-left\" /> <Trans>All</Trans>\n </Link>\n )}\n {[\n {\n label: t`Accounts`,\n type: 'accounts',\n to: `/search?q=${encodeURIComponent(q)}&type=accounts`,\n },\n {\n label: t`Hashtags`,\n type: 'hashtags',\n to: `/search?q=${encodeURIComponent(q)}&type=hashtags`,\n },\n {\n label: t`Posts`,\n type: 'statuses',\n to: `/search?q=${encodeURIComponent(q)}&type=statuses`,\n },\n ]\n .sort((a, b) => {\n if (a.type === type) return -1;\n if (b.type === type) return 1;\n return 0;\n })\n .map((link) => (\n <Link to={link.to} key={link.type}>\n {link.label}\n </Link>\n ))}\n </div>\n )}\n {!!q ? (\n <>\n {(!type || type === 'accounts') && (\n <>\n {type !== 'accounts' && (\n <h2 class=\"timeline-header\">\n <Trans>Accounts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=accounts`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {accountResults.length > 0 ? (\n <>\n <ul class=\"timeline flat accounts-list\">\n {accountResults.map((account) => (\n <li key={account.id}>\n <AccountBlock\n account={account}\n instance={instance}\n showStats\n relationship={relationshipsMap[account.id]}\n />\n </li>\n ))}\n </ul>\n {type !== 'accounts' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=accounts`}\n >\n <Trans>See more accounts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No accounts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'hashtags') && (\n <>\n {type !== 'hashtags' && (\n <h2 class=\"timeline-header\">\n <Trans>Hashtags</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=hashtags`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {hashtagResults.length > 0 ? (\n <>\n <ul class=\"link-list hashtag-list\">\n {hashtagResults.map((hashtag) => {\n const { name, history } = hashtag;\n const total = history?.reduce?.(\n (acc, cur) => acc + +cur.uses,\n 0,\n );\n return (\n <li key={`${name}-${total}`}>\n <Link\n to={\n instance\n ? `/${instance}/t/${name}`\n : `/t/${name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" />\n <span>{name}</span>\n {!!total && (\n <span class=\"count\">\n {shortenNumber(total)}\n </span>\n )}\n </Link>\n </li>\n );\n })}\n </ul>\n {type !== 'hashtags' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=hashtags`}\n >\n <Trans>See more hashtags</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'statuses') && (\n <>\n {type !== 'statuses' && (\n <h2 class=\"timeline-header\">\n <Trans>Posts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=statuses`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {statusResults.length > 0 ? (\n <>\n <ul class=\"timeline\">\n {statusResults.map((status) => (\n <li key={status.id}>\n <Link\n class=\"status-link\"\n to={\n instance\n ? `/${instance}/s/${status.id}`\n : `/s/${status.id}`\n }\n >\n <Status status={status} />\n </Link>\n </li>\n ))}\n </ul>\n {type !== 'statuses' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=statuses`}\n >\n <Trans>See more posts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No posts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {!!type &&\n (uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadResults();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadResults()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n ))}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>\n Enter your search term or paste a URL above to get started.\n </Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default Search;\n","import '../components/links-bar.css';\nimport './trending.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport { filteredItems } from '../utils/filters';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst TREND_CACHE_TIME = 10 * 60 * 1000; // 10 minutes\n\nconst fetchLinks = pmem(\n (masto) => {\n return masto.v1.trends.links.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nconst fetchHashtags = pmem(\n (masto) => {\n return masto.v1.trends.tags.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nfunction fetchTrendsStatuses(masto) {\n if (supports('@pixelfed/trending')) {\n return masto.pixelfed.v2.discover.posts.trending.list({\n range: 'daily',\n });\n }\n return masto.v1.trends.statuses.list({\n limit: LIMIT,\n });\n}\n\nfunction fetchLinkList(masto, params) {\n return masto.v1.timelines.link.list(params);\n}\n\nfunction Trending({ columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = t`Trending (${instance})`;\n useTitle(title, `/:instance?/trending`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const sameCurrentInstance = instance === currentInstance;\n\n const [hashtags, setHashtags] = useState([]);\n const [links, setLinks] = useState([]);\n const trendIterator = useRef();\n\n async function fetchTrends(firstLoad) {\n console.log('fetchTrend', firstLoad);\n if (firstLoad || !trendIterator.current) {\n trendIterator.current = fetchTrendsStatuses(masto);\n\n // Get hashtags\n if (supports('@mastodon/trending-hashtags')) {\n try {\n // const iterator = masto.v1.trends.tags.list();\n const { value: tags } = await fetchHashtags(masto);\n console.log('tags', tags);\n if (tags?.length) {\n setHashtags(tags);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n // Get links\n if (supports('@mastodon/trending-links')) {\n try {\n const { value } = await fetchLinks(masto, instance);\n // 4 types available: link, photo, video, rich\n // Only want links for now\n const links = value?.filter?.((link) => link.type === 'link');\n console.log('links', links);\n if (links?.length) {\n setLinks(links);\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n const results = await trendIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public'); // Might not work here\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n // Link mentions\n // https://github.com/mastodon/mastodon/pull/30381\n const [currentLinkMentionsLoading, setCurrentLinkMentionsLoading] =\n useState(false);\n const currentLinkMentionsIterator = useRef();\n const [currentLink, setCurrentLink] = useState(null);\n const hasCurrentLink = !!currentLink;\n const currentLinkRef = useRef();\n const supportsTrendingLinkPosts =\n sameCurrentInstance && supports('@mastodon/trending-link-posts');\n\n useEffect(() => {\n if (currentLink && currentLinkRef.current) {\n currentLinkRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n });\n }\n }, [currentLink]);\n\n const prevCurrentLink = useRef();\n async function fetchLinkMentions(firstLoad) {\n if (firstLoad || !currentLinkMentionsIterator.current) {\n setCurrentLinkMentionsLoading(true);\n currentLinkMentionsIterator.current = fetchLinkList(masto, {\n url: currentLink,\n });\n }\n prevCurrentLink.current = currentLink;\n const results = await currentLinkMentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n if (prevCurrentLink.current === currentLink) {\n setCurrentLinkMentionsLoading(false);\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.trends.statuses\n .list({\n limit: 1,\n // NOT SUPPORTED\n // since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n value = filteredItems(value, 'public');\n if (value?.length && value[0].id !== latestItem.current) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <>\n {!!hashtags.length && (\n <div class=\"filter-bar expandable\">\n <Icon icon=\"chart\" class=\"insignificant\" size=\"l\" />\n {hashtags.map((tag, i) => {\n const { name, history } = tag;\n const total = history.reduce((acc, cur) => acc + +cur.uses, 0);\n return (\n <Link to={`/${instance}/t/${name}`} key={name}>\n <span dir=\"auto\">\n <span class=\"more-insignificant\">#</span>\n {name}\n </span>\n <span class=\"filter-count\">{shortenNumber(total)}</span>\n </Link>\n );\n })}\n </div>\n )}\n {!!links.length && (\n <div class=\"links-bar\">\n <header>\n <h3>\n <Trans>Trending News</Trans>\n </h3>\n </header>\n {links.map((link) => {\n const {\n authors,\n authorName,\n authorUrl,\n blurhash,\n description,\n height,\n image,\n imageDescription,\n language,\n providerName,\n providerUrl,\n publishedAt,\n title,\n url,\n width,\n } = link;\n const author = authors?.[0]?.account?.id\n ? authors[0].account\n : null;\n const isShortTitle = title.length < 30;\n const hasAuthor = !!(authorName || author);\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <div key={url}>\n <a\n ref={currentLink === url ? currentLinkRef : null}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`link-block ${\n hasCurrentLink\n ? currentLink === url\n ? 'active'\n : 'inactive'\n : ''\n }`}\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(',')})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>&middot; </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class={`description ${\n hasAuthor && !isShortTitle ? '' : 'more-lines'\n }`}\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n {hasAuthor && (\n <>\n <hr />\n <p class=\"byline\">\n <small>\n <Trans comment=\"By [Author]\">\n By{' '}\n {author ? (\n <NameText account={author} showAvatar />\n ) : authorUrl ? (\n <a\n href={authorUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {authorName}\n </a>\n ) : (\n authorName\n )}\n </Trans>\n </small>\n </p>\n </>\n )}\n </div>\n </article>\n </a>\n {supportsTrendingLinkPosts && (\n <button\n type=\"button\"\n class=\"small plain4 block\"\n onClick={() => {\n setCurrentLink(url);\n }}\n disabled={url === currentLink}\n >\n <Icon icon=\"comment2\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </div>\n );\n })}\n </div>\n )}\n {supportsTrendingLinkPosts && !!links.length && (\n <div\n class={`timeline-header-block ${hasCurrentLink ? 'blended' : ''}`}\n >\n {hasCurrentLink ? (\n <>\n <div style={{ width: 50, flexShrink: 0, textAlign: 'center' }}>\n {currentLinkMentionsLoading ? (\n <Loader abrupt />\n ) : (\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setCurrentLink(null);\n }}\n >\n <Icon icon=\"x\" alt={t`Back to showing trending posts`} />\n </button>\n )}\n </div>\n <p>\n <Trans>\n Showing posts mentioning{' '}\n <span class=\"link-text\">\n {currentLink\n .replace(/^https?:\\/\\/(www\\.)?/i, '')\n .replace(/\\/$/, '')}\n </span>\n </Trans>\n </p>\n </>\n ) : (\n <p class=\"insignificant\">\n <Trans>Trending posts</Trans>\n </p>\n )}\n </div>\n )}\n </>\n );\n }, [hashtags, links, currentLink, currentLinkMentionsLoading]);\n\n return (\n <Timeline\n key={instance}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>\n <Trans>Trending</Trans>\n </b>\n <div>{instance}</div>\n </h1>\n }\n id=\"trending\"\n instance={instance}\n emptyText={t`No trending posts.`}\n errorText={t`Unable to load posts`}\n fetchItems={hasCurrentLink ? fetchLinkMentions : fetchTrends}\n checkForUpdates={hasCurrentLink ? undefined : checkForUpdates}\n checkForUpdatesInterval={5 * 60 * 1000} // 5 minutes\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n timelineStart={TimelineStart}\n refresh={currentLink}\n clearWhenRefresh\n view={hasCurrentLink ? 'link-mentions' : undefined}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/trending`);\n location.hash = `/${newInstance}/trending`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/trending`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Trending;\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport Bookmarks from '../pages/bookmarks';\nimport Favourites from '../pages/favourites';\nimport Following from '../pages/following';\nimport Hashtag from '../pages/hashtag';\nimport List from '../pages/list';\nimport Mentions from '../pages/mentions';\nimport Notifications from '../pages/notifications';\nimport Public from '../pages/public';\nimport Search from '../pages/search';\nimport Trending from '../pages/trending';\nimport isRTL from '../utils/is-rtl';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n};\n\nfunction Columns() {\n useTitle(t`Home`, '/');\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n\n console.debug('RENDER Columns', shortcuts);\n\n const components = shortcuts.map((shortcut) => {\n if (!shortcut) return null;\n const { type, ...params } = shortcut;\n const Component = {\n following: Following,\n notifications: Notifications,\n list: List,\n public: Public,\n bookmarks: Bookmarks,\n favourites: Favourites,\n hashtag: Hashtag,\n mentions: Mentions,\n trending: Trending,\n search: Search,\n }[type];\n if (!Component) return null;\n // Don't show Search column with no query, for now\n if (type === 'search' && !params.query) return null;\n // Don't show List column with no list, for now\n if (type === 'list' && !params.id) return null;\n return (\n <Component key={type + JSON.stringify(params)} {...params} columnMode />\n );\n });\n\n useHotkeys(['1', '2', '3', '4', '5', '6', '7', '8', '9'], (e, handler) => {\n try {\n const index = parseInt(handler.keys[0], 10) - 1;\n const $column = document.querySelectorAll('#columns > *')[index];\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\n }\n } catch (e) {\n console.error(e);\n }\n });\n\n useHotkeys(['[', ']'], (e, handler) => {\n const key = handler.keys[0];\n const currentFocusedColumn = document.activeElement.closest('#columns > *');\n\n const rtl = isRTL();\n const prevColKey = rtl ? ']' : '[';\n const nextColKey = rtl ? '[' : ']';\n let $column;\n\n if (key === prevColKey) {\n // If [, focus on left of focused column, else first column\n $column = currentFocusedColumn\n ? currentFocusedColumn.previousElementSibling\n : document.querySelectorAll('#columns > *')[0];\n } else if (key === nextColKey) {\n // If ], focus on right of focused column, else 2nd column\n $column = currentFocusedColumn\n ? currentFocusedColumn.nextElementSibling\n : document.querySelectorAll('#columns > *')[1];\n }\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\n }\n });\n\n return (\n <div\n id=\"columns\"\n onContextMenu={(e) => {\n // If right-click on header, but not links or buttons\n if (\n e.target.closest('.deck > header') &&\n !e.target.closest('a') &&\n !e.target.closest('button')\n ) {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }\n }}\n onFocus={() => {\n // Get current focused column\n const currentFocusedColumn =\n document.activeElement.closest('#columns > *');\n if (currentFocusedColumn) {\n // Remove focus classes from all columns\n // Add focus class to current focused column\n document.querySelectorAll('#columns > *').forEach((column) => {\n column.classList.toggle('focus', column === currentFocusedColumn);\n });\n }\n }}\n >\n {components}\n </div>\n );\n}\n\nexport default Columns;\n","import './notifications-menu.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { ControlledMenu } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Columns from '../components/columns';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Notification from '../components/notification';\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport { massageNotifications2 } from '../utils/group-notifications';\nimport states, { saveStatus } from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Following from './following';\nimport {\n getGroupedNotifications,\n mastoFetchNotifications,\n} from './notifications';\n\nfunction Home() {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n __BENCHMARK.end('time-to-home');\n useEffect(() => {\n (async () => {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n states.showDrafts = true;\n }\n }\n })();\n }, []);\n\n return (\n <>\n {(snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !!snapStates.shortcuts?.length ? (\n <Columns />\n ) : (\n <Following\n title={_(msg`Home`)}\n path=\"/\"\n id=\"home\"\n headerStart={false}\n headerEnd={<NotificationsLink />}\n />\n )}\n </>\n );\n}\n\nfunction NotificationsLink() {\n const snapStates = useSnapshot(states);\n const notificationLinkRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n return (\n <>\n <Link\n ref={notificationLinkRef}\n to=\"/notifications\"\n class={`button plain notifications-button ${\n snapStates.notificationsShowNew ? 'has-badge' : ''\n } ${menuState || ''}`}\n onClick={(e) => {\n e.stopPropagation();\n if (window.matchMedia('(min-width: calc(40em))').matches) {\n e.preventDefault();\n setMenuState((state) => (!state ? 'open' : undefined));\n }\n }}\n >\n <Icon icon=\"notification\" size=\"l\" alt={t`Notifications`} />\n </Link>\n <NotificationsMenu\n state={menuState}\n anchorRef={notificationLinkRef}\n onClose={() => setMenuState(undefined)}\n />\n </>\n );\n}\n\nconst NOTIFICATIONS_DISPLAY_LIMIT = 5;\nfunction NotificationsMenu({ anchorRef, state, onClose }) {\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n\n const notificationsIterator = mastoFetchNotifications();\n\n async function fetchNotifications() {\n const allNotifications = await notificationsIterator.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n const [hasFollowRequests, setHasFollowRequests] = useState(false);\n function fetchFollowRequests() {\n return masto.v1.followRequests.list({\n limit: 1,\n });\n }\n\n function loadNotifications() {\n setUIState('loading');\n (async () => {\n try {\n await fetchNotifications();\n const followRequests = await fetchFollowRequests();\n setHasFollowRequests(!!followRequests?.length);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n if (state === 'open') loadNotifications();\n }, [state]);\n\n const menuRef = useRef();\n\n return (\n <ControlledMenu\n ref={menuRef}\n menuClassName=\"notifications-menu\"\n state={state}\n anchorRef={anchorRef}\n onClose={onClose}\n portal={{\n target: document.body,\n }}\n containerProps={{\n onClick: () => {\n menuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding=\"8 8 8 8\"\n >\n <header>\n <h2>\n <Trans>Notifications</Trans>\n </h2>\n </header>\n <main>\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n .slice(0, NOTIFICATIONS_DISPLAY_LIMIT)\n .map((notification) => (\n <Notification\n key={notification._ids || notification.id}\n instance={instance}\n notification={notification}\n disableContextMenu\n />\n ))}\n </>\n ) : uiState === 'loading' ? (\n <div class=\"ui-state\">\n <Loader abrupt />\n </div>\n ) : (\n uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to fetch notifications.</Trans>\n </p>\n <p>\n <button type=\"button\" onClick={loadNotifications}>\n <Trans>Try again</Trans>\n </button>\n </p>\n </div>\n )\n )}\n </main>\n <footer>\n <Link to=\"/mentions\" class=\"button plain\">\n <Icon icon=\"at\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </Link>\n <Link to=\"/notifications\" class=\"button plain2\">\n {hasFollowRequests ? (\n <Trans>\n <span class=\"tag collapsed\">New</span>{' '}\n <span>Follow Requests</span>\n </Trans>\n ) : (\n <b>\n <Trans>See all</Trans>\n </b>\n )}{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </footer>\n </ControlledMenu>\n );\n}\n\nexport default memo(Home);\n","// export const statusRegex = /\\/@([^@\\/]+)@?([^\\/]+)?\\/([^\\/]+)\\/?$/i;\n// export const statusNoteRegex = /\\/notes\\/([^\\/]+)\\/?$/i;\n\nconst statusPostRegexes = [\n /^\\/@[^@\\/]+\\/(?:statuses|posts)\\/([^\\/]+)/i, // GoToSocial, Takahe\n /\\/notes\\/([^\\/]+)/i, // Misskey, Firefish\n /^\\/(?:notice|objects)\\/([a-z0-9-]+)/i, // Pleroma\n /\\/@[^@\\/]+\\/post\\/([^\\/]+)/i, // Threads\n /\\/@[^@\\/]+@?[^\\/]+?\\/([^\\/]+)/i, // Mastodon\n /^\\/p\\/[^\\/]+\\/([^\\/]+)/i, // Pixelfed\n];\n\nexport function getInstanceStatusObject(url) {\n // Regex /:username/:id, where username = @username or @username@domain, id = anything\n const { hostname, pathname } = URL.parse(url);\n // const [, username, domain, id] = pathname.match(statusRegex) || [];\n for (const regex of statusPostRegexes) {\n const [, id] = pathname.match(regex) || [];\n console.log(pathname, regex, id);\n if (id) {\n return {\n instance: hostname,\n id,\n };\n }\n }\n return {};\n}\n\nfunction getInstanceStatusURL(url) {\n const { instance, id } = getInstanceStatusObject(url);\n if (instance && id) {\n return `/${instance}/s/${id}`;\n }\n return null;\n}\n\nexport default getInstanceStatusURL;\n","import { t, Trans } from '@lingui/macro';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport { api } from '../utils/api';\nimport getInstanceStatusURL, {\n getInstanceStatusObject,\n} from '../utils/get-instance-status-url';\n\nexport default function HttpRoute() {\n const location = useLocation();\n const url = location.pathname.replace(/^\\//, '');\n const statusObject = getInstanceStatusObject(url);\n // const statusURL = getInstanceStatusURL(url);\n const statusURL = statusObject?.instance\n ? `/${statusObject.instance}/s/${statusObject.id}`\n : null;\n const [uiState, setUIState] = useState('loading');\n\n useLayoutEffect(() => {\n setUIState('loading');\n (async () => {\n // Check if status returns 200\n try {\n const { instance, id } = statusObject;\n if (id) {\n const { masto } = api({ instance });\n const status = await masto.v1.statuses.$select(id).fetch();\n if (status) {\n window.location.hash = statusURL + '?view=full';\n return;\n }\n }\n } catch (e) {}\n\n // Fallback to search\n {\n const { masto: currentMasto, instance: currentInstance } = api();\n const result = await currentMasto.v2.search.fetch({\n q: url,\n limit: 1,\n resolve: true,\n });\n if (result.statuses.length) {\n const status = result.statuses[0];\n window.location.hash = `/${currentInstance}/s/${status.id}?view=full`;\n } else if (result.accounts.length) {\n const account = result.accounts[0];\n window.location.hash = `/${currentInstance}/a/${account.id}`;\n } else if (statusURL) {\n // Fallback to original URL, which will probably show error\n window.location.hash = statusURL + '?view=full';\n } else {\n setUIState('error');\n }\n }\n })();\n }, [statusURL]);\n\n return (\n <div class=\"ui-state\" tabIndex=\"-1\">\n {uiState === 'loading' ? (\n <>\n <Loader abrupt />\n <h2>\n <Trans>Resolving…</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n ) : (\n <>\n <h2>\n <Trans>Unable to resolve URL</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n )}\n <hr />\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n </div>\n );\n}\n","import './lists.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useReducer, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport { fetchLists } from '../utils/lists';\nimport useTitle from '../utils/useTitle';\n\nfunction Lists() {\n useTitle(t`Lists`, `/l`);\n const [uiState, setUIState] = useState('default');\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [lists, setLists] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await fetchLists();\n console.log(lists);\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div id=\"lists-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" />\n </Link>\n </div>\n <h1>\n <Trans>Lists</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => setShowListAddEditModal(true)}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New list`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {lists.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {lists.map((list) => (\n <li>\n <Link to={`/l/${list.id}`}>\n <span>\n <Icon icon=\"list\" /> <span>{list.title}</span>\n </span>\n {/* <button\n type=\"button\"\n class=\"plain\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setShowListAddEditModal({\n list,\n });\n }}\n >\n <Icon icon=\"pencil\" />\n </button> */}\n </Link>\n </li>\n ))}\n </ul>\n {lists.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural value={lists.length} one=\"# list\" other=\"# lists\" />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nexport default Lists;\n","export default \"__VITE_ASSET__Y_wpqkTO__\"","function dec2hex(dec) {\n return ('0' + dec.toString(16)).slice(-2);\n}\nexport function verifier() {\n var array = new Uint32Array(56 / 2);\n window.crypto.getRandomValues(array);\n return Array.from(array, dec2hex).join('');\n}\nfunction sha256(plain) {\n // returns promise ArrayBuffer\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n return window.crypto.subtle.digest('SHA-256', data);\n}\nfunction base64urlencode(a) {\n let str = '';\n const bytes = new Uint8Array(a);\n const len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n str += String.fromCharCode(bytes[i]);\n }\n return btoa(str).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nexport async function generateCodeChallenge(v) {\n const hashed = await sha256(v);\n return base64urlencode(hashed);\n}\n\n// If /.well-known/oauth-authorization-server exists and code_challenge_methods_supported includes \"S256\", means support PKCE\nexport async function supportsPKCE({ instanceURL }) {\n if (!instanceURL) return false;\n try {\n const res = await fetch(\n `https://${instanceURL}/.well-known/oauth-authorization-server`,\n );\n if (!res.ok || res.status !== 200) return false;\n const json = await res.json();\n if (json.code_challenge_methods_supported?.includes('S256')) return true;\n return false;\n } catch (e) {\n return false;\n }\n}\n\n// For debugging\nwindow.__generateCodeChallenge = generateCodeChallenge;\n","import { generateCodeChallenge, verifier } from './oauth-pkce';\n\nconst {\n DEV,\n PHANPY_CLIENT_NAME: CLIENT_NAME,\n PHANPY_WEBSITE: WEBSITE,\n} = import.meta.env;\n\nconst SCOPES = 'read write follow push';\n\n/*\n PHANPY_WEBSITE is set to the default official site.\n It's used in pre-built releases, so there's no way to change it dynamically\n without rebuilding.\n Therefore, we can't use it as redirect_uri.\n We only use PHANPY_WEBSITE if it's \"same\" as current location URL.\n \n Very basic check based on location.hostname for now\n*/\nconst sameSite = WEBSITE\n ? WEBSITE.toLowerCase().includes(location.hostname)\n : false;\nconst currentLocation = location.origin + location.pathname;\nconst REDIRECT_URI = DEV || !sameSite ? currentLocation : WEBSITE;\n\nexport async function registerApplication({ instanceURL }) {\n const registrationParams = new URLSearchParams({\n client_name: CLIENT_NAME,\n redirect_uris: REDIRECT_URI,\n scopes: SCOPES,\n website: WEBSITE,\n });\n const registrationResponse = await fetch(\n `https://${instanceURL}/api/v1/apps`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: registrationParams.toString(),\n },\n );\n const registrationJSON = await registrationResponse.json();\n console.log({ registrationJSON });\n return registrationJSON;\n}\n\nexport async function getPKCEAuthorizationURL({ instanceURL, client_id }) {\n const codeVerifier = verifier();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const params = new URLSearchParams({\n client_id,\n code_challenge_method: 'S256',\n code_challenge: codeChallenge,\n redirect_uri: REDIRECT_URI,\n response_type: 'code',\n scope: SCOPES,\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${params.toString()}`;\n return [authorizationURL, codeVerifier];\n}\n\nexport async function getAuthorizationURL({ instanceURL, client_id }) {\n const authorizationParams = new URLSearchParams({\n client_id,\n scope: SCOPES,\n redirect_uri: REDIRECT_URI,\n // redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',\n response_type: 'code',\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${authorizationParams.toString()}`;\n return authorizationURL;\n}\n\nexport async function getAccessToken({\n instanceURL,\n client_id,\n client_secret,\n code,\n code_verifier,\n}) {\n const params = new URLSearchParams({\n client_id,\n redirect_uri: REDIRECT_URI,\n grant_type: 'authorization_code',\n code,\n scope: SCOPES,\n // client_secret,\n // code_verifier,\n });\n if (client_secret) {\n params.append('client_secret', client_secret);\n }\n if (code_verifier) {\n params.append('code_verifier', code_verifier);\n }\n const tokenResponse = await fetch(`https://${instanceURL}/oauth/token`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: params.toString(),\n });\n const tokenJSON = await tokenResponse.json();\n console.log({ tokenJSON });\n return tokenJSON;\n}\n","import './login.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport Fuse from 'fuse.js';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport instancesListURL from '../data/instances.json?url';\nimport {\n getAuthorizationURL,\n getPKCEAuthorizationURL,\n registerApplication,\n} from '../utils/auth';\nimport { supportsPKCE } from '../utils/oauth-pkce';\nimport store from '../utils/store';\nimport useTitle from '../utils/useTitle';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nfunction Login() {\n useTitle('Log in');\n const instanceURLRef = useRef();\n const cachedInstanceURL = store.local.get('instanceURL');\n const [uiState, setUIState] = useState('default');\n const [searchParams] = useSearchParams();\n const instance = searchParams.get('instance');\n const submit = searchParams.get('submit');\n const [instanceText, setInstanceText] = useState(\n instance || cachedInstanceURL?.toLowerCase() || '',\n );\n\n const [instancesList, setInstancesList] = useState([]);\n const searcher = useRef();\n useEffect(() => {\n (async () => {\n try {\n const res = await fetch(instancesListURL);\n const data = await res.json();\n setInstancesList(data);\n searcher.current = new Fuse(data);\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n })();\n }, []);\n\n // useEffect(() => {\n // if (cachedInstanceURL) {\n // instanceURLRef.current.value = cachedInstanceURL.toLowerCase();\n // }\n // }, []);\n\n const submitInstance = (instanceURL) => {\n if (!instanceURL) return;\n\n (async () => {\n // WEB_DOMAIN vs LOCAL_DOMAIN negotiation time\n // https://docs.joinmastodon.org/admin/config/#web_domain\n try {\n const res = await fetch(`https://${instanceURL}/.well-known/host-meta`); // returns XML\n const text = await res.text();\n // Parse XML\n const parser = new DOMParser();\n const xmlDoc = parser.parseFromString(text, 'text/xml');\n // Get Link[template]\n const link = xmlDoc.getElementsByTagName('Link')[0];\n const template = link.getAttribute('template');\n const url = URL.parse(template);\n const { host } = url; // host includes the port\n if (instanceURL !== host) {\n console.log(`💫 ${instanceURL} -> ${host}`);\n instanceURL = host;\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n\n store.local.set('instanceURL', instanceURL);\n\n setUIState('loading');\n try {\n const { client_id, client_secret, vapid_key } =\n await registerApplication({\n instanceURL,\n });\n\n const authPKCE = await supportsPKCE({ instanceURL });\n console.log({ authPKCE });\n if (authPKCE) {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n const [url, verifier] = await getPKCEAuthorizationURL({\n instanceURL,\n client_id,\n });\n store.sessionCookie.set('codeVerifier', verifier);\n location.href = url;\n } else {\n alert(t`Failed to register application`);\n }\n } else {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n location.href = await getAuthorizationURL({\n instanceURL,\n client_id,\n });\n } else {\n alert(t`Failed to register application`);\n }\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const cleanInstanceText = instanceText\n ? instanceText\n .replace(/^https?:\\/\\//, '') // Remove protocol from instance URL\n .replace(/\\/+$/, '') // Remove trailing slash\n .replace(/^@?[^@]+@/, '') // Remove @?acct@\n .trim()\n : null;\n const instanceTextLooksLikeDomain =\n /[^\\s\\r\\n\\t\\/\\\\]+\\.[^\\s\\r\\n\\t\\/\\\\]+/.test(cleanInstanceText) &&\n !/[\\s\\/\\\\@]/.test(cleanInstanceText);\n\n const instancesSuggestions = cleanInstanceText\n ? searcher.current\n ?.search(cleanInstanceText, {\n limit: 10,\n })\n ?.map((match) => match.item)\n : [];\n\n const selectedInstanceText = instanceTextLooksLikeDomain\n ? cleanInstanceText\n : instancesSuggestions?.length\n ? instancesSuggestions[0]\n : instanceText\n ? instancesList.find((instance) => instance.includes(instanceText))\n : null;\n\n const onSubmit = (e) => {\n e.preventDefault();\n // const { elements } = e.target;\n // let instanceURL = elements.instanceURL.value.toLowerCase();\n // // Remove protocol from instance URL\n // instanceURL = instanceURL.replace(/^https?:\\/\\//, '').replace(/\\/+$/, '');\n // // Remove @acct@ or acct@ from instance URL\n // instanceURL = instanceURL.replace(/^@?[^@]+@/, '');\n // if (!/\\./.test(instanceURL)) {\n // instanceURL = instancesList.find((instance) =>\n // instance.includes(instanceURL),\n // );\n // }\n // submitInstance(instanceURL);\n submitInstance(selectedInstanceText);\n };\n\n if (submit) {\n useEffect(() => {\n submitInstance(instance || selectedInstanceText);\n }, []);\n }\n\n return (\n <main id=\"login\" style={{ textAlign: 'center' }}>\n <form onSubmit={onSubmit}>\n <h1>\n <img src={logo} alt=\"\" width=\"80\" height=\"80\" />\n <br />\n <Trans>Log in</Trans>\n </h1>\n <label>\n <p>\n <Trans>Instance</Trans>\n </p>\n <input\n value={instanceText}\n required\n type=\"text\"\n class=\"large\"\n id=\"instanceURL\"\n ref={instanceURLRef}\n disabled={uiState === 'loading'}\n // list=\"instances-list\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n spellCheck={false}\n placeholder={t`instance domain`}\n onInput={(e) => {\n setInstanceText(e.target.value);\n }}\n dir=\"auto\"\n />\n {instancesSuggestions?.length > 0 ? (\n <ul id=\"instances-suggestions\">\n {instancesSuggestions.map((instance, i) => (\n <li>\n <button\n type=\"button\"\n class=\"plain5\"\n onClick={() => {\n submitInstance(instance);\n }}\n >\n {instance}\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <div id=\"instances-eg\">\n <Trans>e.g. &ldquo;mastodon.social&rdquo;</Trans>\n </div>\n )}\n {/* <datalist id=\"instances-list\">\n {instancesList.map((instance) => (\n <option value={instance} />\n ))}\n </datalist> */}\n </label>\n {uiState === 'error' && (\n <p class=\"error\">\n <Trans>\n Failed to log in. Please try again or try another instance.\n </Trans>\n </p>\n )}\n <div>\n <button\n disabled={\n uiState === 'loading' || !instanceText || !selectedInstanceText\n }\n >\n {selectedInstanceText\n ? t`Continue with ${selectedInstanceText}`\n : t`Continue`}\n </button>{' '}\n </div>\n <Loader hidden={uiState !== 'loading'} />\n <hr />\n {!DEFAULT_INSTANCE && (\n <p>\n <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">\n <Trans>Don't have an account? Create one!</Trans>\n </a>\n </p>\n )}\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n <LangSelector />\n </form>\n </main>\n );\n}\n\nexport default Login;\n","import './status.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuHeader, MenuItem } from '@szhsin/react-menu';\nimport debounce from 'just-debounce-it';\nimport pRetry from 'p-retry';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { matchPath, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MediaModal from '../components/media-modal';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport htmlContentLength from '../utils/html-content-length';\nimport shortenNumber from '../utils/shorten-number';\nimport states, {\n getStatus,\n saveStatus,\n statusKey,\n threadifyStatus,\n} from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { getCurrentAccount } from '../utils/store-utils';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nimport getInstanceStatusURL from './../utils/get-instance-status-url';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nconst LIMIT = 40;\nconst SUBCOMMENTS_OPEN_ALL_LIMIT = 10;\nconst MAX_WEIGHT = 5;\n\nlet cachedRepliesToggle = {};\nlet cachedStatusesMap = {};\nlet scrollPositions = {};\nfunction resetScrollPosition(id) {\n delete cachedStatusesMap[id];\n delete scrollPositions[id];\n}\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\n// Select all statuses except those inside collapsed details/summary\n// Hat-tip to @AmeliaBR@front-end.social\n// https://front-end.social/@AmeliaBR/109784776146144471\nconst STATUSES_SELECTOR =\n '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)';\n\nconst STATUS_URL_REGEX = /\\/s\\//i;\n\nfunction StatusPage(params) {\n const { id } = params;\n const { masto, instance } = api({ instance: params.instance });\n const snapStates = useSnapshot(states);\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaOnlyParam = searchParams.get('media-only');\n const mediaIndex = parseInt(mediaParam || mediaOnlyParam, 10);\n let showMedia = mediaIndex > 0;\n const mediaStatusID = searchParams.get('mediaStatusID');\n const mediaStatus = getStatus(mediaStatusID, instance);\n if (mediaStatusID && !mediaStatus) {\n showMedia = false;\n }\n const showMediaOnly = showMedia && !!mediaOnlyParam;\n\n const sKey = statusKey(id, instance);\n const [heroStatus, setHeroStatus] = useState(states.statuses[sKey]);\n useEffect(() => {\n if (states.statuses[sKey]) {\n setHeroStatus(states.statuses[sKey]);\n }\n }, [sKey]);\n\n const closeLink = useMemo(() => {\n const { prevLocation } = states;\n const pathname =\n (prevLocation?.pathname || '') + (prevLocation?.search || '');\n const matchStatusPath =\n matchPath('/:instance/s/:id', pathname) || matchPath('/s/:id', pathname);\n if (!pathname || matchStatusPath) {\n return '/';\n }\n return pathname;\n }, []);\n\n useEffect(() => {\n if (!heroStatus && showMedia) {\n (async () => {\n try {\n const status = await masto.v1.statuses.$select(id).fetch();\n saveStatus(status, instance);\n setHeroStatus(status);\n } catch (err) {\n console.error(err);\n alert('Unable to load post.');\n location.hash = closeLink;\n }\n })();\n }\n }, [showMedia]);\n\n const mediaAttachments = mediaStatusID\n ? snapStates.statuses[statusKey(mediaStatusID, instance)]?.mediaAttachments\n : heroStatus?.mediaAttachments;\n\n const handleMediaClose = useCallback(() => {\n if (\n !window.matchMedia('(min-width: calc(40em + 350px))').matches &&\n snapStates.prevLocation\n ) {\n history.back();\n } else {\n if (showMediaOnly) {\n location.hash = closeLink;\n } else {\n searchParams.delete('media');\n searchParams.delete('mediaStatusID');\n setSearchParams(searchParams);\n }\n }\n }, [showMediaOnly, closeLink, snapStates.prevLocation]);\n\n useEffect(() => {\n let timer = setTimeout(() => {\n // carouselRef.current?.focus?.();\n const $carousel = document.querySelector('.carousel');\n if ($carousel) {\n $carousel.focus();\n }\n }, 100);\n return () => clearTimeout(timer);\n }, [showMediaOnly]);\n\n useEffect(() => {\n const $deckContainers = document.querySelectorAll('.deck-container');\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.setAttribute('inert', '');\n });\n return () => {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n };\n }, []);\n\n return (\n <div class=\"deck-backdrop\">\n {showMedia ? (\n mediaAttachments?.length ? (\n <MediaModal\n mediaAttachments={mediaAttachments}\n statusID={mediaStatusID || id}\n instance={instance}\n lang={heroStatus?.language}\n index={mediaIndex - 1}\n onClose={handleMediaClose}\n />\n ) : (\n <div class=\"media-modal-container loading\">\n <Loader abrupt />\n </div>\n )\n ) : (\n <Link to={closeLink} />\n )}\n {!showMediaOnly && (\n <StatusThread\n id={id}\n instance={params.instance}\n closeLink={closeLink}\n />\n )}\n </div>\n );\n}\n\nfunction StatusParent(props) {\n const { linkable, to, onClick, ...restProps } = props;\n return linkable ? (\n <Link class=\"status-link\" to={to} onClick={onClick} {...restProps} />\n ) : (\n <div class=\"status-focus\" tabIndex={0} {...restProps} />\n );\n}\n\n// oldest first\nfunction createdAtSort(a, b) {\n return new Date(b.created_at) - new Date(a.created_at);\n}\n\nfunction StatusThread({ id, closeLink = '/', instance: propInstance }) {\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaStatusID = searchParams.get('mediaStatusID');\n const showMedia = parseInt(mediaParam, 10) > 0;\n const firstLoad = useRef(\n !states.prevLocation &&\n (history.length === 1 ||\n ('navigation' in window && navigation?.entries?.()?.length === 1)),\n );\n const [viewMode, setViewMode] = useState(\n searchParams.get('view') || firstLoad.current ? 'full' : null,\n );\n const translate = !!parseInt(searchParams.get('translate'));\n const { masto, instance } = api({ instance: propInstance });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n const snapStates = useSnapshot(states);\n const [statuses, setStatuses] = useState([]);\n const [uiState, setUIState] = useState('default');\n const heroStatusRef = useRef();\n const sKey = statusKey(id, instance);\n const totalDescendants = useRef(0);\n\n const scrollableRef = useRef();\n useEffect(() => {\n scrollableRef.current?.focus();\n }, []);\n useEffect(() => {\n const onScroll = debounce(() => {\n // console.log('onScroll');\n if (!scrollableRef.current) return;\n const { scrollTop } = scrollableRef.current;\n if (uiState !== 'loading') {\n scrollPositions[id] = scrollTop;\n }\n }, 50);\n scrollableRef.current?.addEventListener('scroll', onScroll, {\n passive: true,\n });\n onScroll();\n return () => {\n onScroll.cancel();\n scrollableRef.current?.removeEventListener('scroll', onScroll);\n };\n }, [id, uiState !== 'loading']);\n\n const scrollOffsets = useRef();\n const lastInitContextTS = useRef();\n const initContext = ({ reloadHero } = {}) => {\n console.debug('initContext', id);\n setUIState('loading');\n let heroTimer;\n\n const cachedStatuses = cachedStatusesMap[id];\n if (cachedStatuses) {\n // Case 1: It's cached, let's restore them to make it snappy\n const reallyCachedStatuses = cachedStatuses.filter(\n (s) => states.statuses[sKey],\n // Some are not cached in the global state, so we need to filter them out\n );\n setStatuses(reallyCachedStatuses);\n } else {\n // const heroIndex = statuses.findIndex((s) => s.id === id);\n // if (heroIndex !== -1) {\n // // Case 2: It's in current statuses. Slice off all descendant statuses after the hero status to be safe\n // const slicedStatuses = statuses.slice(0, heroIndex + 1);\n // setStatuses(slicedStatuses);\n // } else {\n // Case 3: Not cached and not in statuses, let's start from scratch\n setStatuses([{ id }]);\n // }\n }\n\n (async () => {\n const heroFetch = () =>\n pRetry(() => masto.v1.statuses.$select(id).fetch(), {\n retries: 4,\n });\n const contextFetch = pRetry(\n () => masto.v1.statuses.$select(id).context.fetch(),\n {\n retries: 8,\n },\n );\n\n const hasStatus = !!snapStates.statuses[sKey];\n let heroStatus = snapStates.statuses[sKey];\n if (hasStatus && !reloadHero) {\n console.debug('Hero status is cached');\n } else {\n try {\n heroStatus = await heroFetch();\n saveStatus(heroStatus, instance);\n // Give time for context to appear\n await new Promise((resolve) => {\n setTimeout(resolve, 100);\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n return;\n }\n }\n\n try {\n const context = await contextFetch;\n const { ancestors, descendants } = context;\n\n ancestors.sort(createdAtSort);\n descendants.sort(createdAtSort);\n\n totalDescendants.current = descendants?.length || 0;\n\n const missingStatuses = new Set();\n ancestors.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n if (\n status.inReplyToId &&\n !ancestors.find((s) => s.id === status.inReplyToId)\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n });\n const ancestorsIsThread = ancestors.every(\n (s) => s.account.id === heroStatus.account.id,\n );\n const nestedDescendants = [];\n descendants.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n\n if (\n status.inReplyToId &&\n !descendants.find((s) => s.id === status.inReplyToId) &&\n status.inReplyToId !== heroStatus.id\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n\n if (status.inReplyToAccountId === status.account.id) {\n // If replying to self, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else if (status.inReplyToId === heroStatus.id) {\n // If replying to the hero status, it's a reply, level 1\n nestedDescendants.push(status);\n } else if (\n !status.inReplyToAccountId &&\n nestedDescendants.find(\n (s) =>\n s.id === status.inReplyToId &&\n s.account.id === heroStatus.account.id,\n ) &&\n status.account.id === heroStatus.account.id\n ) {\n // If replying to hero's own statuses, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else {\n // If replying to someone else, it's a reply to a reply, level 2\n const parent = descendants.find((s) => s.id === status.inReplyToId);\n if (parent) {\n if (!parent.__replies) {\n parent.__replies = [];\n }\n parent.__replies.push(status);\n } else {\n // If no parent, something is wrong\n console.warn('No parent found for', status);\n }\n }\n });\n\n // sort hero author to top\n nestedDescendants.sort((a, b) => {\n const heroAccountID = heroStatus.account.id;\n if (a.account.id === heroAccountID && b.account.id !== heroAccountID)\n return -1;\n if (b.account.id === heroAccountID && a.account.id !== heroAccountID)\n return 1;\n return 0;\n });\n\n console.log({ ancestors, descendants, nestedDescendants });\n if (missingStatuses.size) {\n console.error('Missing statuses', [...missingStatuses]);\n }\n\n let descendantLevelsCount = 1;\n function expandReplies(_replies, level) {\n const nextLevel = level + 1;\n if (nextLevel > descendantLevelsCount) {\n descendantLevelsCount = level;\n }\n return _replies?.map((_r) => ({\n id: _r.id,\n account: _r.account,\n repliesCount: _r.repliesCount,\n content: _r.content,\n weight: calcStatusWeight(_r),\n level: nextLevel,\n replies: expandReplies(_r.__replies, nextLevel),\n }));\n }\n\n const allStatuses = [\n ...ancestors.map((s) => ({\n id: s.id,\n ancestor: true,\n isThread: ancestorsIsThread,\n accountID: s.account.id,\n account: s.account,\n repliesCount: s.repliesCount,\n weight: calcStatusWeight(s),\n })),\n {\n id,\n accountID: heroStatus.account.id,\n weight: calcStatusWeight(heroStatus),\n },\n ...nestedDescendants.map((s) => ({\n id: s.id,\n account: s.account,\n accountID: s.account.id,\n descendant: true,\n thread: s.account.id === heroStatus.account.id,\n weight: calcStatusWeight(s),\n level: 1,\n replies: expandReplies(s.__replies, 1),\n })),\n ];\n\n setUIState('default');\n scrollOffsets.current = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n\n // Set limit to hero's index\n // const heroLimit = allStatuses.findIndex((s) => s.id === id);\n const heroLimit = ancestors.length || 0; // 0-indexed\n if (heroLimit >= limit) {\n setLimit(heroLimit + 1);\n }\n\n console.log({ allStatuses, descendantLevelsCount });\n setStatuses(allStatuses);\n cachedStatusesMap[id] = allStatuses;\n\n // Let's threadify this one\n // Note that all non-hero statuses will trigger saveStatus which will threadify them too\n // By right, at this point, all descendant statuses should be cached\n threadifyStatus(heroStatus, instance);\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n lastInitContextTS.current = Date.now();\n\n return () => {\n clearTimeout(heroTimer);\n };\n };\n\n useEffect(initContext, [id, masto]);\n\n const [showRefresh, setShowRefresh] = useState(false);\n useEffect(() => {\n let interval = setInterval(() => {\n const now = Date.now();\n if (\n lastInitContextTS.current &&\n now - lastInitContextTS.current >= 60_000\n ) {\n setShowRefresh(true);\n }\n }, 60_000); // 1 minute\n return () => {\n clearInterval(interval);\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!statuses.length) return;\n console.debug('STATUSES', statuses);\n const scrollPosition = scrollPositions[id];\n console.debug('scrollPosition', scrollPosition);\n if (!!scrollPosition) {\n console.debug('Case 1', {\n id,\n scrollPosition,\n });\n scrollableRef.current.scrollTop = scrollPosition;\n } else if (scrollOffsets.current) {\n const newScrollOffsets = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n const newScrollTop =\n newScrollOffsets.offsetTop -\n scrollOffsets.current.offsetTop +\n newScrollOffsets.scrollTop;\n console.debug('Case 2', {\n scrollOffsets: scrollOffsets.current,\n newScrollOffsets,\n newScrollTop,\n statuses: [...statuses],\n });\n scrollableRef.current.scrollTop = newScrollTop;\n } else if (statuses.length === 1) {\n console.debug('Case 3', {\n id,\n });\n scrollableRef.current.scrollTop = 0;\n }\n\n // RESET\n scrollOffsets.current = null;\n }, [statuses]);\n\n useEffect(() => {\n if (snapStates.reloadStatusPage <= 0) return;\n // Delete the cache for the context\n (async () => {\n try {\n const { instanceURL } = getCurrentAccount();\n const contextURL = `https://${instanceURL}/api/v1/statuses/${id}/context`;\n console.log('Clear cache', contextURL);\n const apiCache = await caches.open('api');\n await apiCache.delete(contextURL, { ignoreVary: true });\n\n return initContext({\n reloadHero: true,\n });\n } catch (e) {\n console.error(e);\n }\n })();\n }, [snapStates.reloadStatusPage]);\n\n useEffect(() => {\n return () => {\n // RESET\n scrollPositions = {};\n states.reloadStatusPage = 0;\n cachedStatusesMap = {};\n cachedRepliesToggle = {};\n statusWeightCache.clear();\n };\n }, []);\n\n const heroStatus = snapStates.statuses[sKey] || snapStates.statuses[id];\n const heroDisplayName = useMemo(() => {\n // Remove shortcodes from display name\n if (!heroStatus) return '';\n const { account } = heroStatus;\n const div = document.createElement('div');\n div.innerHTML = account.displayName;\n return div.innerText.trim();\n }, [heroStatus]);\n const heroContentText = useMemo(() => {\n if (!heroStatus) return '';\n let text = statusPeek(heroStatus);\n if (text.length > 64) {\n // \"The title should ideally be less than 64 characters in length\"\n // https://www.w3.org/Provider/Style/TITLE.html\n text = text.slice(0, 64) + '…';\n }\n return text;\n }, [heroStatus]);\n useTitle(\n heroDisplayName && heroContentText\n ? `${heroDisplayName}: \"${heroContentText}\"`\n : t({\n id: 'post.title',\n message: 'Post',\n }),\n '/:instance?/s/:id',\n );\n\n const postInstance = useMemo(() => {\n if (!heroStatus) return;\n const { url } = heroStatus;\n if (!url) return;\n return URL.parse(url).hostname;\n }, [heroStatus]);\n const postSameInstance = useMemo(() => {\n if (!postInstance) return;\n return postInstance === instance;\n }, [postInstance, instance]);\n\n const [limit, setLimit] = useState(LIMIT);\n const showMore = useMemo(() => {\n // return number of statuses to show\n return statuses.length - limit;\n }, [statuses.length, limit]);\n\n const hasDescendants = statuses.some((s) => s.descendant);\n const ancestors = statuses.filter((s) => s.ancestor);\n\n const [heroInView, setHeroInView] = useState(true);\n const heroPointer = useMemo(() => {\n // get top offset of heroStatus\n if (!heroStatusRef.current || heroInView) return null;\n const { top } = heroStatusRef.current.getBoundingClientRect();\n return top > 0 ? 'down' : 'up';\n }, [heroInView]);\n\n useHotkeys(\n 'esc',\n () => {\n location.hash = closeLink;\n },\n {\n // If media is open, esc to close media first\n // Else close the status page\n enabled: !showMedia,\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n // For backspace, will always close both media and status page\n useHotkeys('backspace', () => {\n location.hash = closeLink;\n });\n\n useHotkeys('j', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n console.log({ allStatusLinks });\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let nextStatus = allStatusLinks[activeStatusIndex + 1];\n if (nextStatus) {\n nextStatus.focus();\n nextStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n useHotkeys('k', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let prevStatus = allStatusLinks[activeStatusIndex - 1];\n if (prevStatus) {\n prevStatus.focus();\n prevStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n // NOTE: I'm not sure if 'x' is the best shortcut for this, might change it later\n // IDEA: x is for expand\n useHotkeys('x', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const details = activeStatus.nextElementSibling;\n if (details && details.tagName.toLowerCase() === 'details') {\n details.open = !details.open;\n }\n }\n });\n\n const [reachTopPost, setReachTopPost] = useState(false);\n // const { nearReachStart } = useScroll({\n // scrollableRef,\n // distanceFromStartPx: 16,\n // });\n\n const initialPageState = useRef(showMedia ? 'media+status' : 'status');\n\n const handleMediaClick = useCallback(\n (e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n },\n [id],\n );\n\n const handleStatusLinkClick = useCallback((e, status) => {\n resetScrollPosition(status.id);\n }, []);\n\n useEffect(() => {\n let timer;\n if (mediaStatusID && showMedia) {\n timer = setTimeout(() => {\n const status = scrollableRef.current?.querySelector(\n `.status-link[href*=\"/${mediaStatusID}\"]`,\n );\n if (status) {\n status.scrollIntoView(scrollIntoViewOptions);\n }\n }, 400); // After CSS transition\n }\n return () => {\n clearTimeout(timer);\n };\n }, [mediaStatusID, showMedia]);\n\n const renderStatus = useCallback(\n (status, i) => {\n const {\n id: statusID,\n ancestor,\n isThread,\n descendant,\n thread,\n replies,\n repliesCount,\n weight,\n level,\n } = status;\n const isHero = statusID === id;\n const isLinkable = isThread || ancestor;\n\n return (\n <li\n key={statusID}\n ref={isHero ? heroStatusRef : null}\n class={`${ancestor ? 'ancestor' : ''} ${\n descendant ? 'descendant' : ''\n } ${thread ? 'thread' : ''} ${isHero ? 'hero' : ''}`}\n >\n {isHero ? (\n <>\n <InView\n threshold={0.1}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setHeroInView(inView);\n });\n });\n }}\n class=\"status-focus\"\n tabIndex={0}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size=\"l\"\n enableTranslate\n forceTranslate={translate}\n />\n </InView>\n {uiState !== 'loading' && !authenticated ? (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n You're not logged in. Interactions (reply, boost, etc) are\n not possible.\n </Trans>\n </p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n <Trans>Log in</Trans>\n </Link>\n </div>\n ) : (\n !sameInstance && (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n This post is from another instance (<b>{instance}</b>).\n Interactions (reply, boost, etc) are not possible.\n </Trans>\n </p>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n const results = await currentMasto.v2.search.fetch({\n q: heroStatus.url,\n type: 'statuses',\n resolve: true,\n limit: 1,\n });\n if (results.statuses.length) {\n const status = results.statuses[0];\n location.hash = currentInstance\n ? `/${currentInstance}/s/${status.id}`\n : `/s/${status.id}`;\n } else {\n throw new Error('No results');\n }\n } catch (e) {\n setUIState('default');\n alert(t`Error: ${e}`);\n console.error(e);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>\n Switch to my instance to enable interactions\n </Trans>\n </button>\n </div>\n )\n )}\n </>\n ) : (\n <StatusParent\n linkable={isLinkable}\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n >\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n > */}\n {i === 0 && ancestor ? (\n <InView\n threshold={0.5}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setReachTopPost(inView);\n });\n });\n }}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n />\n </InView>\n ) : (\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n showActionsBar={!!descendant}\n />\n )}\n {ancestor && repliesCount > 1 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={repliesCount}>\n {shortenNumber(repliesCount)}\n </span>\n </div>\n )}{' '}\n {/* {replies?.length > LIMIT && (\n <div class=\"replies-link\">\n <Icon icon=\"comment\" />{' '}\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>\n </div>\n )} */}\n </StatusParent>\n // </Link>\n )}\n {descendant && replies?.length > 0 && (\n <SubComments\n instance={instance}\n replies={replies}\n hasParentThread={thread}\n level={level}\n accWeight={weight}\n openAll={totalDescendants.current < SUBCOMMENTS_OPEN_ALL_LIMIT}\n parentLink={{\n to: instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`,\n onClick: () => resetScrollPosition(statusID),\n }}\n />\n )}\n {uiState === 'loading' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-loading\">\n <Loader abrupt={heroStatus.repliesCount >= 3} />\n </div>\n )}\n {uiState === 'error' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-error\">\n <Trans>Unable to load replies.</Trans>\n <br />\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </div>\n )}\n </li>\n );\n },\n [\n id,\n instance,\n uiState,\n authenticated,\n sameInstance,\n translate,\n handleMediaClick,\n handleStatusLinkClick,\n hasDescendants,\n ],\n );\n\n const prevLocationIsStatusPage = useMemo(() => {\n // Navigation API\n if ('navigation' in window && navigation?.entries) {\n const prevEntry = navigation.entries()[navigation.currentEntry.index - 1];\n if (prevEntry?.url) {\n return STATUS_URL_REGEX.test(prevEntry.url);\n }\n }\n return STATUS_URL_REGEX.test(states.prevLocation?.pathname);\n }, [sKey]);\n\n const moreStatusesKeys = useMemo(() => {\n if (!showMore) return [];\n const ids = [];\n function getIDs(status) {\n ids.push(status.id);\n if (status.replies) {\n status.replies.forEach(getIDs);\n }\n }\n statuses.slice(limit).forEach(getIDs);\n return ids.map((id) => statusKey(id, instance));\n }, [showMore, statuses, limit, instance]);\n\n const statusesList = useMemo(\n () => statuses.slice(0, limit).map(renderStatus),\n [statuses, limit, renderStatus],\n );\n\n // If there's spoiler in hero status, auto-expand it\n useEffect(() => {\n let timer = setTimeout(() => {\n if (!heroStatusRef.current) return;\n const spoilerButton = heroStatusRef.current.querySelector(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n );\n if (spoilerButton) spoilerButton.click();\n }, 1000);\n return () => clearTimeout(timer);\n }, [id]);\n\n return (\n <div\n tabIndex=\"-1\"\n ref={scrollableRef}\n class={`status-deck deck contained ${\n statuses.length > 1 ? 'padded-bottom' : ''\n } ${\n initialPageState.current === 'status' && !firstLoad.current\n ? 'slide-in'\n : ''\n } ${viewMode ? `deck-view-${viewMode}` : ''}`}\n onAnimationEnd={(e) => {\n // Fix the bounce effect when switching viewMode\n // `slide-in` animation kicks in when switching viewMode\n if (initialPageState.current === 'status') {\n // e.target.classList.remove('slide-in');\n initialPageState.current = null;\n }\n }}\n >\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onDblClick={(e) => {\n // reload statuses\n states.reloadStatusPage++;\n }}\n >\n {/* <div>\n <Link class=\"button plain deck-close\" href={closeLink}>\n <Icon icon=\"chevron-left\" size=\"xl\" />\n </Link>\n </div> */}\n <div class=\"header-grid header-grid-2\">\n <h1>\n {prevLocationIsStatusPage && (\n <button\n type=\"button\"\n class=\"plain deck-back\"\n onClick={() => {\n history.back();\n }}\n >\n <Icon icon=\"chevron-left\" size=\"xl\" alt={t`Back`} />\n </button>\n )}\n {!heroInView && heroStatus && uiState !== 'loading' ? (\n <>\n <span class=\"hero-heading\">\n <NameText\n account={heroStatus.account}\n instance={instance}\n showAvatar\n short\n />{' '}\n <span class=\"insignificant\">\n &bull;{' '}\n <RelativeTime\n datetime={heroStatus.createdAt}\n format=\"micro\"\n />\n </span>\n </span>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n heroStatusRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }}\n title={t`Go to main post`}\n >\n <Icon\n icon={heroPointer === 'down' ? 'arrow-down' : 'arrow-up'}\n />\n </button>\n </>\n ) : (\n <>\n <Trans id=\"post.title\">Post</Trans>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n // Scroll to top\n e.preventDefault();\n e.stopPropagation();\n scrollableRef.current.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n hidden={!ancestors.length || reachTopPost}\n title={t`${ancestors.length} posts above Go to top`}\n >\n <Icon icon=\"arrow-up\" />\n {ancestors\n .filter(\n (a, i, arr) =>\n arr.findIndex((b) => b.accountID === a.accountID) === i,\n )\n .slice(0, 3)\n .map((ancestor) => (\n <Avatar\n key={ancestor.account.id}\n url={ancestor.account.avatar}\n alt={ancestor.account.displayName}\n />\n ))}\n {/* <Icon icon=\"comment\" />{' '} */}\n {ancestors.length > 3 && (\n <>\n {' '}\n <span class=\"insignificant\">\n {shortenNumber(ancestors.length)}\n </span>\n </>\n )}\n </button>\n </>\n )}\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain4 button-switch-view\"\n style={{\n display: viewMode === 'full' ? '' : 'none',\n }}\n onClick={() => {\n setViewMode(null);\n searchParams.delete('media');\n searchParams.delete('media-only');\n searchParams.delete('view');\n setSearchParams(searchParams);\n }}\n title={t`Switch to Side Peek view`}\n >\n <Icon icon=\"layout4\" size=\"l\" />\n </button>\n {showRefresh && (\n <button\n type=\"button\"\n class=\"plain button-refresh\"\n onClick={() => {\n states.reloadStatusPage++;\n setShowRefresh(false);\n }}\n >\n <Icon icon=\"refresh\" size=\"l\" alt={t`Refresh`} />\n </button>\n )}\n <Menu2\n align=\"end\"\n portal={{\n // Need this, else the menu click will cause scroll jump\n target: scrollableRef.current,\n }}\n menuButton={\n <button type=\"button\" class=\"button plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Icon icon=\"refresh\" />\n <span>\n <Trans>Refresh</Trans>\n </span>\n </MenuItem>\n <MenuItem\n className=\"menu-switch-view\"\n onClick={() => {\n setViewMode(viewMode === 'full' ? null : 'full');\n searchParams.delete('media');\n searchParams.delete('media-only');\n if (viewMode === 'full') {\n searchParams.delete('view');\n } else {\n searchParams.set('view', 'full');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon\n icon={\n {\n '': 'layout5',\n full: 'layout4',\n }[viewMode || '']\n }\n />\n <span>\n {viewMode === 'full'\n ? t`Switch to Side Peek view`\n : t`Switch to Full view`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n // Click all buttons with class .spoiler but not .spoiling\n const buttons = Array.from(\n scrollableRef.current.querySelectorAll(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n ),\n );\n buttons.forEach((button) => {\n button.click();\n });\n }}\n >\n <Icon icon=\"eye-open\" />{' '}\n <span>\n <Trans>Show all sensitive content</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuHeader className=\"plain\">\n <Trans>Experimental</Trans>\n </MenuHeader>\n <MenuItem\n disabled={!postInstance || postSameInstance}\n onClick={() => {\n const statusURL = getInstanceStatusURL(heroStatus.url);\n if (statusURL) {\n location.hash = statusURL;\n } else {\n alert(t`Unable to switch`);\n }\n }}\n >\n <Icon icon=\"transfer\" />\n <small class=\"menu-double-lines\">\n {postInstance\n ? t`Switch to post's instance (${punycode.toUnicode(\n postInstance,\n )})`\n : t`Switch to post's instance`}\n </small>\n </MenuItem>\n </Menu2>\n <Link class=\"button plain deck-close\" to={closeLink}>\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </Link>\n </div>\n </div>\n </header>\n {!!statuses.length && heroStatus ? (\n <ul\n class={`timeline flat contextual grow ${\n uiState === 'loading' ? 'loading' : ''\n }`}\n >\n {statusesList}\n {showMore > 0 && (\n <li>\n <button\n type=\"button\"\n class=\"plain block show-more\"\n disabled={uiState === 'loading'}\n onClick={() => setLimit((l) => l + LIMIT)}\n style={{ marginBlockEnd: '6em' }}\n data-state-post-ids={moreStatusesKeys.join(' ')}\n >\n <div class=\"ib avatars-bunch\">\n {/* show avatars for first 5 statuses */}\n {statuses.slice(limit, limit + 5).map((status) => (\n <Avatar\n key={status.id}\n url={status.account.avatarStatic}\n // title={`${status.avatar.displayName} (@${status.avatar.acct})`}\n />\n ))}\n </div>{' '}\n <div class=\"ib\">\n <Trans>Show more…</Trans>{' '}\n <span class=\"tag\">\n {showMore > LIMIT ? `${LIMIT}+` : showMore}\n </span>\n </div>\n </button>\n </li>\n )}\n </ul>\n ) : (\n <>\n {uiState === 'loading' && (\n <ul class=\"timeline flat contextual grow loading\">\n <li>\n <Status skeleton size=\"l\" />\n </li>\n </ul>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load post</Trans>\n <br />\n <br />\n <button\n type=\"button\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\nfunction SubComments({\n replies,\n instance,\n hasParentThread,\n level,\n accWeight,\n openAll,\n parentLink,\n}) {\n const [searchParams, setSearchParams] = useSearchParams();\n\n // Total comments count, including sub-replies\n const diveDeep = (replies) => {\n return replies.reduce((acc, reply) => {\n const { repliesCount, replies } = reply;\n const count = replies?.length || repliesCount;\n return acc + count + diveDeep(replies || []);\n }, 0);\n };\n const totalComments = replies.length + diveDeep(replies);\n const sameCount = replies.length === totalComments;\n\n // Get the first 3 accounts, unique by id\n const accounts = replies\n .map((r) => r.account)\n .filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i)\n .slice(0, 3);\n\n const totalWeight = useMemo(() => {\n return replies?.reduce((acc, reply) => {\n return acc + reply?.weight;\n }, accWeight);\n }, [accWeight, replies?.length]);\n\n let open = false;\n if (openAll) {\n open = true;\n } else if (totalWeight <= MAX_WEIGHT) {\n open = true;\n } else if (!hasParentThread && totalComments === 1) {\n const shortReply = calcStatusWeight(replies[0]) < 2;\n if (shortReply) open = true;\n }\n const openBefore = cachedRepliesToggle[replies[0].id];\n\n const handleMediaClick = useCallback((e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n }, []);\n\n const detailsRef = useRef();\n useLayoutEffect(() => {\n function handleScroll(e) {\n // NOTE: this scrollLeft works for RTL too\n // Browsers do the magic for us\n e.target.dataset.scrollLeft = e.target.scrollLeft;\n }\n detailsRef.current?.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n return () => {\n detailsRef.current?.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n // If not open, delay render replies\n const [renderReplies, setRenderReplies] = useState(openBefore || open);\n useEffect(() => {\n let timer;\n if (!openBefore && !open) {\n timer = setTimeout(() => setRenderReplies(true), 100);\n }\n return () => clearTimeout(timer);\n }, [openBefore, open]);\n\n const Container = open ? 'div' : 'details';\n const isDetails = Container === 'details';\n\n return (\n <Container\n ref={detailsRef}\n class=\"replies\"\n open={isDetails ? openBefore || open : undefined}\n onToggle={\n isDetails\n ? (e) => {\n const { open } = e.target;\n // use first reply as ID\n cachedRepliesToggle[replies[0].id] = open;\n }\n : undefined\n }\n style={{\n '--comments-level': level,\n }}\n data-comments-level={level}\n data-comments-level-overflow={level > 4}\n >\n {!open && (\n <summary class=\"replies-summary\" hidden={open}>\n <span class=\"avatars\">\n {accounts.map((a) => (\n <Avatar\n key={a.id}\n url={a.avatarStatic}\n title={`${a.displayName} @${a.username}`}\n squircle={a?.bot}\n />\n ))}\n </span>\n <span class=\"replies-counts\">\n <b>\n <Plural\n value={replies.length}\n one=\"# reply\"\n other={\n <Trans>\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>{' '}\n replies\n </Trans>\n }\n />\n </b>\n {!sameCount && totalComments > 1 && (\n <>\n {' '}\n &middot;{' '}\n <span>\n <Plural\n value={totalComments}\n one=\"# comment\"\n other={\n <Trans>\n <span title={totalComments}>\n {shortenNumber(totalComments)}\n </span>{' '}\n comments\n </Trans>\n }\n />\n </span>\n </>\n )}\n </span>\n <Icon icon=\"chevron-down\" class=\"replies-summary-chevron\" />\n {!!parentLink && (\n <Link\n class=\"replies-parent-link\"\n to={parentLink.to}\n onClick={parentLink.onClick}\n title={t`View post with its replies`}\n >\n &raquo;\n </Link>\n )}\n </summary>\n )}\n {renderReplies && (\n <ul>\n {replies.map((r) => (\n <li key={r.id}>\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`}\n onClick={() => {\n resetScrollPosition(r.id);\n }}\n > */}\n <div class=\"status-focus\" tabIndex={0}>\n <Status\n statusID={r.id}\n instance={instance}\n withinContext\n size=\"s\"\n enableTranslate\n onMediaClick={handleMediaClick}\n showActionsBar\n />\n {!r.replies?.length && r.repliesCount > 0 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={r.repliesCount}>\n {shortenNumber(r.repliesCount)}\n </span>\n </div>\n )}\n </div>\n {/* </Link> */}\n {r.replies?.length && (\n <SubComments\n instance={instance}\n replies={r.replies}\n level={r.level}\n accWeight={!open ? r.weight : totalWeight}\n openAll={openAll}\n parentLink={{\n to: instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`,\n onClick: () => {\n resetScrollPosition(r.id);\n },\n }}\n />\n )}\n </li>\n ))}\n </ul>\n )}\n </Container>\n );\n}\n\nconst MEDIA_VIRTUAL_LENGTH = 140;\nconst POLL_VIRTUAL_LENGTH = 35;\nconst CARD_VIRTUAL_LENGTH = 70;\nconst WEIGHT_SEGMENT = 140;\nconst statusWeightCache = new Map();\nfunction calcStatusWeight(status) {\n const cachedWeight = statusWeightCache.get(status.id);\n if (cachedWeight) return cachedWeight;\n const { spoilerText, content, mediaAttachments, poll, card } = status;\n const length = htmlContentLength(spoilerText + content);\n const mediaLength = mediaAttachments?.length ? MEDIA_VIRTUAL_LENGTH : 0;\n const pollLength = (poll?.options?.length || 0) * POLL_VIRTUAL_LENGTH;\n const cardLength =\n card && (mediaAttachments?.length || poll?.options?.length)\n ? 0\n : CARD_VIRTUAL_LENGTH;\n const totalLength = length + mediaLength + pollLength + cardLength;\n const weight = totalLength / WEIGHT_SEGMENT;\n statusWeightCache.set(status.id, weight);\n return weight;\n}\n\nexport default memo(StatusPage);\n","import { useParams } from 'react-router-dom';\n\nimport Status from './status';\n\nexport default function StatusRoute() {\n const params = useParams();\n const { id, instance } = params;\n return <Status id={id} instance={instance} />;\n}\n","export default \"__VITE_ASSET__W5CngKHO__\"","export default \"__VITE_ASSET__vmqRZ5q5__\"","export default \"__VITE_ASSET__DFAo1Udm__\"","export default \"__VITE_ASSET__D2_o1n6___\"","export default \"__VITE_ASSET__ySLnBMku__\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e\"","import './welcome.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport boostsCarouselUrl from '../assets/features/boosts-carousel.jpg';\nimport groupedNotificationsUrl from '../assets/features/grouped-notifications.jpg';\nimport multiColumnUrl from '../assets/features/multi-column.jpg';\nimport multiHashtagTimelineUrl from '../assets/features/multi-hashtag-timeline.jpg';\nimport nestedCommentsThreadUrl from '../assets/features/nested-comments-thread.jpg';\nimport logoText from '../assets/logo-text.svg';\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst {\n PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE,\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL: DEFAULT_INSTANCE_REGISTRATION_URL,\n} = import.meta.env;\nconst appSite = WEBSITE\n ? WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')\n : null;\nconst appVersion = __BUILD_TIME__\n ? `${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`\n : null;\n\nfunction Welcome() {\n useTitle(null, ['/', '/welcome']);\n return (\n <main id=\"welcome\">\n <div class=\"hero-container\">\n <div class=\"hero-content\">\n <h1>\n <img\n src={logo}\n alt=\"\"\n width=\"160\"\n height=\"160\"\n style={{\n aspectRatio: '1/1',\n marginBlockEnd: -16,\n }}\n />\n <img src={logoText} alt=\"Phanpy\" width=\"200\" />\n </h1>\n <p class=\"desc\">\n <Trans>A minimalistic opinionated Mastodon web client.</Trans>\n </p>\n <p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n {DEFAULT_INSTANCE ? t`Log in` : t`Log in with Mastodon`}\n </Link>\n </p>\n {DEFAULT_INSTANCE && DEFAULT_INSTANCE_REGISTRATION_URL && (\n <p>\n <a href={DEFAULT_INSTANCE_REGISTRATION_URL} class=\"button plain5\">\n <Trans>Sign up</Trans>\n </a>\n </p>\n )}\n {!DEFAULT_INSTANCE && (\n <p class=\"insignificant\">\n <small>\n <Trans>\n Connect your existing Mastodon/Fediverse account.\n <br />\n Your credentials are not stored on this server.\n </Trans>\n </small>\n </p>\n )}\n </div>\n {(appSite || appVersion) && (\n <p class=\"app-site-version\">\n <small>\n {appSite} {appVersion}\n </small>\n </p>\n )}\n <p>\n <Trans>\n <a href=\"https://github.com/cheeaun/phanpy\" target=\"_blank\">\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n target=\"_blank\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n .{' '}\n <a href={PRIVACY_POLICY_URL} target=\"_blank\">\n Privacy Policy\n </a>\n .\n </Trans>\n </p>\n <div>\n <LangSelector />\n </div>\n </div>\n <div id=\"why-container\">\n <div class=\"sections\">\n <section>\n <img\n src={boostsCarouselUrl}\n alt={t`Screenshot of Boosts Carousel`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Boosts Carousel</Trans>\n </h4>\n <p>\n <Trans>\n Visually separate original posts and re-shared posts (boosted\n posts).\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={nestedCommentsThreadUrl}\n alt={t`Screenshot of nested comments thread`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Nested comments thread</Trans>\n </h4>\n <p>\n <Trans>\n Effortlessly follow conversations. Semi-collapsible replies.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={groupedNotificationsUrl}\n alt={t`Screenshot of grouped notifications`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Grouped notifications</Trans>\n </h4>\n <p>\n <Trans>\n Similar notifications are grouped and collapsed to reduce\n clutter.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiColumnUrl}\n alt={t`Screenshot of multi-column UI`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Single or multi-column</Trans>\n </h4>\n <p>\n <Trans>\n By default, single column for zen-mode seekers. Configurable\n multi-column for power users.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiHashtagTimelineUrl}\n alt={t`Screenshot of multi-hashtag timeline with a form to add more hashtags`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Multi-hashtag timeline</Trans>\n </h4>\n <p>\n <Trans>Up to 5 hashtags combined into a single timeline.</Trans>\n </p>\n </section>\n </div>\n </div>\n </main>\n );\n}\n\nexport default Welcome;\n","// Replace alert() with toastify-js\nimport Toastify from 'toastify-js';\n\nconst nativeAlert = window.alert;\nif (!window.__nativeAlert) window.__nativeAlert = nativeAlert;\n\nwindow.alert = function (message) {\n console.debug(\n 'ALERT: This is a custom alert() function. Native alert() is still available as window.__nativeAlert()',\n );\n // If Error object, show the message\n if (message instanceof Error && message?.message) {\n message = message.message;\n }\n // If not string, stringify it\n if (typeof message !== 'string') {\n message = JSON.stringify(message);\n }\n\n const toast = Toastify({\n text: message,\n className: 'alert',\n gravity: 'top',\n position: 'center',\n duration: 10_000,\n offset: {\n y: 48,\n },\n onClick: () => {\n toast.hideToast();\n },\n });\n toast.showToast();\n};\n","import './app.css';\n\nimport { useLingui } from '@lingui/react';\nimport debounce from 'just-debounce-it';\nimport { memo } from 'preact/compat';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { matchPath, Route, Routes, useLocation } from 'react-router-dom';\n\nimport 'swiped-events';\n\nimport { subscribe } from 'valtio';\n\nimport BackgroundService from './components/background-service';\nimport ComposeButton from './components/compose-button';\nimport { ICONS } from './components/ICONS';\nimport KeyboardShortcutsHelp from './components/keyboard-shortcuts-help';\nimport Loader from './components/loader';\nimport Modals from './components/modals';\nimport NotificationService from './components/notification-service';\nimport SearchCommand from './components/search-command';\nimport Shortcuts from './components/shortcuts';\nimport NotFound from './pages/404';\nimport AccountStatuses from './pages/account-statuses';\nimport Bookmarks from './pages/bookmarks';\nimport Catchup from './pages/catchup';\nimport Favourites from './pages/favourites';\nimport Filters from './pages/filters';\nimport FollowedHashtags from './pages/followed-hashtags';\nimport Following from './pages/following';\nimport Hashtag from './pages/hashtag';\nimport Home from './pages/home';\nimport HttpRoute from './pages/http-route';\nimport List from './pages/list';\nimport Lists from './pages/lists';\nimport Login from './pages/login';\nimport Mentions from './pages/mentions';\nimport Notifications from './pages/notifications';\nimport Public from './pages/public';\nimport Search from './pages/search';\nimport StatusRoute from './pages/status-route';\nimport Trending from './pages/trending';\nimport Welcome from './pages/welcome';\nimport {\n api,\n hasInstance,\n hasPreferences,\n initAccount,\n initClient,\n initInstance,\n initPreferences,\n} from './utils/api';\nimport { getAccessToken } from './utils/auth';\nimport focusDeck from './utils/focus-deck';\nimport states, { initStates, statusKey } from './utils/states';\nimport store from './utils/store';\nimport {\n getAccount,\n getCurrentAccount,\n setCurrentAccountID,\n} from './utils/store-utils';\n\nimport './utils/toast-alert';\n\nwindow.__STATES__ = states;\nwindow.__STATES_STATS__ = () => {\n const keys = [\n 'statuses',\n 'accounts',\n 'spoilers',\n 'unfurledLinks',\n 'statusQuotes',\n ];\n const counts = {};\n keys.forEach((key) => {\n counts[key] = Object.keys(states[key]).length;\n });\n console.warn('STATE stats', counts);\n\n const { statuses } = states;\n const unmountedPosts = [];\n for (const key in statuses) {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n if (!$post) {\n unmountedPosts.push(key);\n }\n }\n console.warn('Unmounted posts', unmountedPosts.length, unmountedPosts);\n};\n\n// Experimental \"garbage collection\" for states\n// Every 15 minutes\n// Only posts for now\nsetInterval(() => {\n if (!window.__IDLE__) return;\n const { statuses, unfurledLinks, notifications } = states;\n let keysCount = 0;\n const { instance } = api();\n for (const key in statuses) {\n if (!window.__IDLE__) break;\n try {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n const postInNotifications = notifications.some(\n (n) => key === statusKey(n.status?.id, instance),\n );\n if (!$post && !postInNotifications) {\n delete states.statuses[key];\n delete states.statusQuotes[key];\n for (const link in unfurledLinks) {\n const unfurled = unfurledLinks[link];\n const sKey = statusKey(unfurled.id, unfurled.instance);\n if (sKey === key) {\n delete states.unfurledLinks[link];\n break;\n }\n }\n keysCount++;\n }\n } catch (e) {}\n }\n if (keysCount) {\n console.info(`GC: Removed ${keysCount} keys`);\n }\n}, 15 * 60 * 1000);\n\n// Preload icons\n// There's probably a better way to do this\n// Related: https://github.com/vitejs/vite/issues/10600\nsetTimeout(() => {\n for (const icon in ICONS) {\n setTimeout(() => {\n if (Array.isArray(ICONS[icon])) {\n ICONS[icon][0]?.();\n } else if (typeof ICONS[icon] === 'object') {\n ICONS[icon].module?.();\n } else {\n ICONS[icon]?.();\n }\n }, 1);\n }\n}, 5000);\n\n(() => {\n window.__IDLE__ = true;\n const nonIdleEvents = [\n 'mousemove',\n 'mousedown',\n 'resize',\n 'keydown',\n 'touchstart',\n 'pointerdown',\n 'pointermove',\n 'wheel',\n ];\n const setIdle = () => {\n window.__IDLE__ = true;\n };\n const IDLE_TIME = 3_000; // 3 seconds\n const debouncedSetIdle = debounce(setIdle, IDLE_TIME);\n const onNonIdle = () => {\n window.__IDLE__ = false;\n debouncedSetIdle();\n };\n nonIdleEvents.forEach((event) => {\n window.addEventListener(event, onNonIdle, {\n passive: true,\n capture: true,\n });\n });\n window.addEventListener('blur', setIdle, {\n passive: true,\n });\n // When cursor leaves the window, set idle\n document.documentElement.addEventListener(\n 'mouseleave',\n (e) => {\n if (!e.relatedTarget && !e.toElement) {\n setIdle();\n }\n },\n {\n passive: true,\n },\n );\n // document.addEventListener(\n // 'visibilitychange',\n // () => {\n // if (document.visibilityState === 'visible') {\n // onNonIdle();\n // }\n // },\n // {\n // passive: true,\n // },\n // );\n})();\n\n// Possible fix for iOS PWA theme-color bug\n// It changes when loading web pages in \"webview\"\nconst isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);\nif (isIOS) {\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'visible') {\n // Don't reset theme color if media modal is showing\n // Media modal will set its own theme color based on the media's color\n const showingMediaModal =\n document.getElementsByClassName('media-modal-container').length > 0;\n if (showingMediaModal) return;\n\n const theme = store.local.get('theme');\n let $meta;\n if (theme) {\n // Get current meta\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n const color = $meta.content;\n const tempColor =\n theme === 'light'\n ? $meta.dataset.themeLightColorTemp\n : $meta.dataset.themeDarkColorTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n } else {\n // Get current color scheme\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n // Get current theme-color\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n const color = $meta.dataset.content;\n const tempColor = $meta.dataset.contentTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n }\n }\n });\n}\n\n{\n const theme = store.local.get('theme');\n // If there's a theme, it's NOT auto\n if (theme) {\n // dark | light\n document.documentElement.classList.add(`is-${theme}`);\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute('content', theme || 'dark light');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n const textSize = store.local.get('textSize');\n if (textSize) {\n document.documentElement.style.setProperty('--text-size', `${textSize}px`);\n }\n}\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // Change #app dataset based on settings.shortcutsViewMode\n if (path.join('.') === 'settings.shortcutsViewMode') {\n const $app = document.getElementById('app');\n if ($app) {\n $app.dataset.shortcutsViewMode = states.shortcuts?.length ? value : '';\n }\n }\n\n // Add/Remove cloak class to body\n if (path.join('.') === 'settings.cloakMode') {\n const $body = document.body;\n $body.classList.toggle('cloak', value);\n }\n }\n});\n\nconst BENCHES = new Map();\nwindow.__BENCH_RESULTS = new Map();\nwindow.__BENCHMARK = {\n start(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n // If already started, ignore\n if (BENCHES.has(name)) return;\n const start = performance.now();\n BENCHES.set(name, start);\n },\n end(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n const start = BENCHES.get(name);\n if (start) {\n const end = performance.now();\n const duration = end - start;\n __BENCH_RESULTS.set(name, duration);\n BENCHES.delete(name);\n }\n },\n};\n\nfunction App() {\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [uiState, setUIState] = useState('loading');\n __BENCHMARK.start('app-init');\n __BENCHMARK.start('time-to-following');\n __BENCHMARK.start('time-to-home');\n __BENCHMARK.start('time-to-isLoggedIn');\n useLingui();\n\n useEffect(() => {\n const instanceURL = store.local.get('instanceURL');\n const code = decodeURIComponent(\n (window.location.search.match(/code=([^&]+)/) || [, ''])[1],\n );\n\n if (code) {\n console.log({ code });\n // Clear the code from the URL\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n\n const clientID = store.sessionCookie.get('clientID');\n const clientSecret = store.sessionCookie.get('clientSecret');\n const vapidKey = store.sessionCookie.get('vapidKey');\n const verifier = store.sessionCookie.get('codeVerifier');\n\n (async () => {\n setUIState('loading');\n const { access_token: accessToken } = await getAccessToken({\n instanceURL,\n client_id: clientID,\n client_secret: clientSecret,\n code,\n code_verifier: verifier || undefined,\n });\n\n if (accessToken) {\n const client = initClient({ instance: instanceURL, accessToken });\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instanceURL),\n initAccount(client, instanceURL, accessToken, vapidKey),\n ]);\n initStates();\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n\n setIsLoggedIn(true);\n setUIState('default');\n } else {\n setUIState('error');\n }\n __BENCHMARK.end('app-init');\n })();\n } else {\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n const searchAccount = decodeURIComponent(\n (window.location.search.match(/account=([^&]+)/) || [, ''])[1],\n );\n let account;\n if (searchAccount) {\n account = getAccount(searchAccount);\n console.log('searchAccount', searchAccount, account);\n if (account) {\n setCurrentAccountID(account.info.id);\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n }\n }\n if (!account) {\n account = getCurrentAccount();\n }\n if (account) {\n setCurrentAccountID(account.info.id);\n const { client } = api({ account });\n const { instance } = client;\n // console.log('masto', masto);\n initStates();\n setUIState('loading');\n (async () => {\n try {\n if (hasPreferences() && hasInstance(instance)) {\n // Non-blocking\n initPreferences(client);\n initInstance(client, instance);\n } else {\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instance),\n ]);\n }\n } catch (e) {\n } finally {\n setIsLoggedIn(true);\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n })();\n } else {\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n }\n\n // Cleanup\n store.sessionCookie.del('clientID');\n store.sessionCookie.del('clientSecret');\n store.sessionCookie.del('codeVerifier');\n }, []);\n\n let location = useLocation();\n states.currentLocation = location.pathname;\n // useLayoutEffect(() => {\n // states.currentLocation = location.pathname;\n // }, [location.pathname]);\n\n useEffect(focusDeck, [location, isLoggedIn]);\n\n if (/\\/https?:/.test(location.pathname)) {\n return <HttpRoute />;\n }\n\n if (uiState === 'loading') {\n return <Loader id=\"loader-root\" />;\n }\n\n return (\n <>\n <PrimaryRoutes isLoggedIn={isLoggedIn} />\n <SecondaryRoutes isLoggedIn={isLoggedIn} />\n <Routes>\n <Route path=\"/:instance?/s/:id\" element={<StatusRoute />} />\n </Routes>\n {isLoggedIn && <ComposeButton />}\n {isLoggedIn && <Shortcuts />}\n <Modals />\n {isLoggedIn && <NotificationService />}\n <BackgroundService isLoggedIn={isLoggedIn} />\n <SearchCommand onClose={focusDeck} />\n <KeyboardShortcutsHelp />\n </>\n );\n}\n\nfunction Root({ isLoggedIn }) {\n if (isLoggedIn) {\n __BENCHMARK.end('time-to-isLoggedIn');\n }\n return isLoggedIn ? <Home /> : <Welcome />;\n}\n\nconst PrimaryRoutes = memo(({ isLoggedIn }) => {\n const location = useLocation();\n const nonRootLocation = useMemo(() => {\n const { pathname } = location;\n return !/^\\/(login|welcome)/i.test(pathname);\n }, [location]);\n\n return (\n <Routes location={nonRootLocation || location}>\n <Route path=\"/\" element={<Root isLoggedIn={isLoggedIn} />} />\n <Route path=\"/login\" element={<Login />} />\n <Route path=\"/welcome\" element={<Welcome />} />\n </Routes>\n );\n});\n\nfunction getPrevLocation() {\n return states.prevLocation || null;\n}\nfunction SecondaryRoutes({ isLoggedIn }) {\n // const snapStates = useSnapshot(states);\n const location = useLocation();\n // const prevLocation = snapStates.prevLocation;\n const backgroundLocation = useRef(getPrevLocation());\n\n const isModalPage = useMemo(() => {\n return (\n matchPath('/:instance/s/:id', location.pathname) ||\n matchPath('/s/:id', location.pathname)\n );\n }, [location.pathname, matchPath]);\n if (isModalPage) {\n if (!backgroundLocation.current)\n backgroundLocation.current = getPrevLocation();\n } else {\n backgroundLocation.current = null;\n }\n console.debug({\n backgroundLocation: backgroundLocation.current,\n location,\n });\n\n return (\n <Routes location={backgroundLocation.current || location}>\n {isLoggedIn && (\n <>\n <Route path=\"/notifications\" element={<Notifications />} />\n <Route path=\"/mentions\" element={<Mentions />} />\n <Route path=\"/following\" element={<Following />} />\n <Route path=\"/b\" element={<Bookmarks />} />\n <Route path=\"/f\" element={<Favourites />} />\n <Route path=\"/l\">\n <Route index element={<Lists />} />\n <Route path=\":id\" element={<List />} />\n </Route>\n <Route path=\"/fh\" element={<FollowedHashtags />} />\n <Route path=\"/ft\" element={<Filters />} />\n <Route path=\"/catchup\" element={<Catchup />} />\n </>\n )}\n <Route path=\"/:instance?/t/:hashtag\" element={<Hashtag />} />\n <Route path=\"/:instance?/a/:id\" element={<AccountStatuses />} />\n <Route path=\"/:instance?/p\">\n <Route index element={<Public />} />\n <Route path=\"l\" element={<Public local />} />\n </Route>\n <Route path=\"/:instance?/trending\" element={<Trending />} />\n <Route path=\"/:instance?/search\" element={<Search />} />\n {/* <Route path=\"/:anything\" element={<NotFound />} /> */}\n </Routes>\n );\n}\n\nexport { App };\n","import './index.css';\nimport './cloak-mode.css';\nimport './polyfills';\n\nimport { i18n } from '@lingui/core';\nimport { I18nProvider } from '@lingui/react';\n// Polyfill needed for Firefox < 122\n// https://bugzilla.mozilla.org/show_bug.cgi?id=1423593\n// import '@formatjs/intl-segmenter/polyfill';\nimport { render } from 'preact';\nimport { HashRouter } from 'react-router-dom';\n\nimport { App } from './app';\nimport { initActivateLang } from './utils/lang';\n\ninitActivateLang();\n\nif (import.meta.env.DEV) {\n import('preact/debug');\n}\n\nrender(\n <I18nProvider i18n={i18n}>\n <HashRouter>\n <App />\n </HashRouter>\n </I18nProvider>,\n document.getElementById('app'),\n);\n\n// Storage cleanup\nsetTimeout(() => {\n try {\n // Clean up iconify localStorage\n Object.keys(localStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n localStorage.removeItem(key);\n }\n });\n Object.keys(sessionStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n sessionStorage.removeItem(key);\n }\n });\n\n // Clean up old settings key\n localStorage.removeItem('settings:boostsCarousel');\n } catch (e) {}\n}, 5000);\n\n// Service worker cache cleanup\nif ('serviceWorker' in navigator && typeof caches !== 'undefined') {\n const MAX_SW_CACHE_SIZE = 50;\n const IGNORE_CACHE_KEYS = ['icons'];\n let clearRanOnce = false;\n const FAST_INTERVAL = 10_000; // 10 seconds\n const SLOW_INTERVAL = 60 * 60 * 1000; // 1 hour\n async function clearCaches() {\n if (window.__IDLE__) {\n try {\n const keys = await caches.keys();\n for (const key of keys) {\n if (IGNORE_CACHE_KEYS.includes(key)) continue;\n const cache = await caches.open(key);\n const _keys = await cache.keys();\n if (_keys.length > MAX_SW_CACHE_SIZE) {\n console.warn('Cleaning cache', key, _keys.length);\n const deleteKeys = _keys.slice(MAX_SW_CACHE_SIZE);\n for (const deleteKey of deleteKeys) {\n await cache.delete(deleteKey);\n }\n }\n }\n clearRanOnce = true;\n } catch (e) {} // Silent fail\n }\n // Once cleared, clear again at slower interval\n setTimeout(clearCaches, clearRanOnce ? SLOW_INTERVAL : FAST_INTERVAL);\n }\n setTimeout(clearCaches, FAST_INTERVAL);\n}\n\nwindow.__CLOAK__ = () => {\n document.body.classList.toggle('cloak');\n};\n"],"names":["functionDebounce","debounce","fn","wait","callFirst","timeout","debouncedFn","clear","flush","call","debounceWrapper","context","args","callNow","window","document","event","params","evt","handleTouchStart","handleTouchMove","handleTouchEnd","xDown","yDown","xDiff","yDiff","timeDown","startEl","touchCount","e","swipeThreshold","getNearestAttribute","swipeUnit","swipeTimeout","timeDiff","eventType","changedTouches","eventData","xUp","yUp","el","attributeName","defaultValue","attributeValue","usePageVisibility","deps","savedCallback","useRef","useEffect","current","handleVisibilityChange","hidden","visibilityState","console","STREAMING_TIMEOUT","POLL_INTERVAL","BackgroundService","memo","isLoggedIn","visible","setVisible","useState","visibleTimeout","clearTimeout","setTimeout","checkLatestNotification","masto","instance","skipCheckMarkers","states","notificationsLast","notificationsIterator","v1","notifications","list","limit","sinceId","id","value","next","length","notificationsShowNew","lastReadId","markers","fetch","timeline","sub","streamTimeout","pollNotifications","streaming","api","hasStreaming","user","notification","subscribe","log","entry","_a","checkForUpdates","clearInterval","r","info","useInterval","lastCheckDate","useHotkeys","currentCloakMode","Date","diff","i18n","settings","text","_","ComposeButton","snapStates","useSnapshot","handleButton","composerState","minimized","openOSK","shiftKey","openCompose","showCompose","ignoreEventWhen","querySelector","_jsx","type","onClick","class","publishing","publishingError","children","Icon","icon","size","alt","KeyboardShortcutsHelp","onClose","showKeyboardShortcutsHelp","hasModal","Modal","tabindex","Trans","keys","0","action","className","1","2","map","parents","coords","siblings","animations","intersections","intervals","options","debounces","enabled","root","scrollX","scrollY","TGT","DEL","NEW","handleMutations","mutations","elements","getElements","animate","handleResizes","entries","updateAllPos","updatePos","observePosition","oldObserver","rect","invocations","buffer","getCoords","offsetWidth","offsetHeight","rootMargin","px","observer","optionsOrPlugin","getOptions","delay","isPlugin","currentAnimation","parent","forEach","lowPriority","poll","callback","resize","supportedBrowser","nodes","mutation","node","target","i","child","isMounted","preExisting","add","remain","remove","raw","str","getScrollOffset","p","x","y","getTransitionSizes","oldCoords","newCoords","widthFrom","heightFrom","widthTo","heightTo","styles","paddingY","paddingX","getTarget","isEnabled","callbacks","getPluginTuple","pluginReturn","config","animation","pluginOrOptions","deltaX","deltaY","start","end","keyframes","cleanUp","style","prev","finalX","finalY","top","left","width","height","deletePosition","adjustScroll","styleReset","scrollDeltaX","scrollDeltaY","scrollBefore","lastHeight","lastWidth","startScroll","smoothScroll","offsetParent","parentStyles","parentCoords","autoAnimate","element","useAutoAnimate","controller","setController","setEnabled","isStandalone","matchMedia","matches","Accounts","accounts","store","local","getJSON","currentAccount","getCurrentAccountID","moreThanOneAccount","reload","useReducer","accountsListParent","_jsxs","tabIndex","ref","account","isCurrent","isDefault","Avatar","url","avatarStatic","onDblClick","$select","NameText","test","showAcct","setCurrentAccountID","_Fragment","Menu2","align","menuButton","disabled","location","MenuLink","href","MenuDivider","MenuItem","splice","MenuConfirm","subMenu","confirmLabel","menuItemClassName","Link","to","logo","regionMaps","LangSelector","useLingui","populatedLocales","useMemo","LOCALES","lang","regionlessCode","replace","native","localeCode2Text","code","locale","fallback","CATALOGS","find","c","nativeName","_common","name","sort","a","b","order","localeCompare","DEFAULT_LANG","onChange","set","common","import","createBackendPushSubscription","subscription","push","create","fetchBackendPushSubscription","updateBackendPushSubscription","update","removeBackendPushSubscription","isPushSupported","navigator","getRegistration","serviceWorker","getSubscription","registration","pushManager","undefined","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","outputArray","Uint8Array","charCodeAt","initSubscription","backendSubscription","err","message","sameEndpoint","sameKey","vapidKey","key2","applicationServerKey","vapidKeyStr","applicationServerKeyStr","updateSubscription","data","policy","removeSubscription","DEFAULT_TEXT_SIZE","TEXT_SIZES","PHANPY_WEBSITE","WEBSITE","PHANPY_PRIVACY_POLICY_URL","PRIVACY_POLICY_URL","PHANPY_IMG_ALT_API_URL","IMG_ALT_API_URL","PHANPY_GIPHY_API_KEY","GIPHY_API_KEY","Settings","currentTheme","get","themeFormRef","targetLanguage","contentTranslationTargetLanguage","systemTargetLanguage","getTranslateTargetLanguage","systemTargetLanguageText","currentTextSize","prefs","setPrefs","authenticated","onInput","formData","theme","documentElement","html","classList","$manualMeta","$autoMetas","querySelectorAll","m","toggle","defaultChecked","fontSize","min","max","step","parseInt","setProperty","rel","for","checked","autoRefresh","boostsCarousel","targetLanguages","showCommon","contentTranslationHideLanguages","contentTranslation","composerGIFPicker","mediaAltGenerator","supports","groupedNotificationsAlpha","shortcutSettingsCloudImportExport","cloakMode","PushNotificationsSection","display","flexWrap","gap","lineHeight","src","aspectRatio","verticalAlign","borderRadius","RelativeTime","datetime","readOnly","__BUILD_TIME__","showToast","caches","uiState","setUIState","allowNotifications","setAllowNotifications","setNeedRelogin","pushFormRef","needRelogin","alerts","previousPolicyRef","policyEl","namedItem","isLoading","values","mention","favourite","reblog","follow","follow_request","followRequest","status","key","alertsCount","allowNotifications2","alert","permission","label","components","alert2","focusDeck","timer","columns","getElementById","focusedColumn","focus","firstVisibleColumn","column","getBoundingClientRect","modals","modal","modalFocusElement","pages","page","useLocationChange","useLocation","currentLocationRef","pathname","FETCH_MAX_AGE","MAX_AGE","fetchLists","pmem","lists","title","updatedAt","now","maxAge","getLists","fetchList","getList","theList","getListTitle","addListStore","updateListStore","index","deleteListStore","listID","findIndex","ListAddEdit","editMode","nameFieldRef","repliesPolicyFieldRef","exclusiveFieldRef","repliesPolicy","exclusive","supportsExclusive","onSubmit","preventDefault","FormData","listResult","replies_policy","MUTE_DURATIONS","MUTE_DURATIONS_LABELS","i18nDuration","LIMIT","ACCOUNT_INFO_MAX_AGE","fetchFamiliarFollowers","currentID","familiarFollowers","memFetchFamiliarFollowers","fetchPostingStats","accountID","fetchStatuses","statuses","total","originals","replies","stats","boosts","memFetchPostingStats","fetchAccount","standalone","i18n2","currentMasto","currentInstance","isString","setInfo","sameCurrentInstance","info2","acct","avatar","bot","createdAt","displayName","emojis","fields","group","lastStatusAt","locked","note","statusesCount","username","memorial","moved","roles","hideCollections","header","headerStatic","headerIsAvatar","isSelf","infoHasEssentials","account2","updated","punycode","accountInstance","setHeaderCornerColors","followersIterator","toUnicode","domain","fetchFollowers","firstLoad","familiarFollowersCache","results","newValue","familiarFollowers2","familiar","followingIterator","LinkOrDiv","accountLink","postingStats","setPostingStats","renderFamiliarFollowers","setFamiliarFollowers","postingStatsUIState","setPostingStatsUIState","hasPostingStats","followers","renderPostingStats","onRelationshipChange","onProfileUpdate","useCallback","newAccount","headerCornerColors","stopPropagation","onError","ctx","canvas","onLoad","pixelDimension","rgbColors","OffscreenCanvas","createElement","g","imageSmoothingEnabled","drawImage","colors","getImageData","dataLength","lightenRGB","color","AccountBlock","avatarSize","handleWithInstance","clipboard","enhanceContent","verifiedAt","__html","EmojiText","blankCopy","follower","followersCount","shortenNumber","fetchFollowing","followingCount","excludeRelationshipAttrs","hideTime","daysSinceLastPost","FAMILIAR_FOLLOWERS_LIMIT","relationshipUIState","setRelationshipUIState","setRelationship","sameInstance","following","showingReblogs","currentInfo","setCurrentInfo","notifying","followedBy","blocking","blockedBy","muting","mutingNotifications","requested","domainBlocking","endorsed","privateNote","acctWithInstance","setIsSelf","q","fetchRelationships","relationships","relationship2","relationship","showAddRemoveLists","setShowAddRemoveLists","showPrivateNoteModal","setLists","updateAccount","showTranslatedBio","showEditProfile","setShowPrivateNoteModal","lists2","currentAuthenticated","onMenuChange","setShowTranslatedBio","handle","niceAccountURL","newRelationship","counter","duration","error","setShowEditProfile","Loader","loading","TranslatedBioSheet","EditProfileSheet","AddRemoveListsSheet","luminence","alpha","urlObj","host","state","getHTMLText","fieldsText","Math","path","listsContainingAccount2","reloadCount","showListAddEditModal","setShowListAddEditModal","setListsContainingAccount","listsContainingAccount","inList","accountIds","result","PrivateNoteSheet","initialNote","textareaRef","_b","e2","trim","setAccount","acc","source","fieldsAttributesRef","displayName2","note2","fieldsAttributesFields","field","fieldsAttributes","FieldsAttributesRow","hasValue","setHasValue","AccountHandleInfo","server","maxLength","required","AccountSheet","propInstance","AccountInfo","lookup","skip_webfinger","v2","search","resolve","accountURL","URL","parse","hostname","Drafts","drafts","setDrafts","db","ns","getCurrentAccountNS","ownKeys","filter","startsWith","getMany","getTime","hasDrafts","abrupt","draft","draftStatus","replyTo","updatedAtDate","replyToStatus","MiniDraft","spoilerText","mediaAttachments","hasPoll","hasMedia","firstImageMedia","image","file","objectURL","createObjectURL","hasPollOrMedia","EmbedModal","dangerouslySetInnerHTML","GenericAccounts","postID","isCurrentInstance","setAccounts","showMore","setShowMore","showGenericAccounts","heading","fetchAccounts","staticAccounts","showReactions","relationshipsMap","setRelationshipsMap","loadRelationships","loadAccounts","done","Array","isArray","theAccount","j","_types","newAccounts","reloadGenericAccounts","post","Status","showStats","InView","MediaAltModal","forceTranslate","setForceTranslate","differentLanguage","localeMatch","l","supportsTTS","speak","dir","whiteSpace","textWrap","TranslationBlock","sourceLanguage","classToType","obj","unpack","keyOrder","k","PI","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","multiplyMatrices","A","B","B_cols","product","row","col","labConstants","compand","linear","sign","xyz2rgb","z","MtxAdaptMa","MtxAdaptMaI","MtxXYZ2RGB","RefWhiteRGB","Xn","Yn","Zn","LAB_CONSTANTS","As","Bs","Cs","Ad","Bd","Cd","X1","Y1","Z1","X2","Y2","Z2","oklab2rgb","L","rest","X","Y","Z","OKLab_to_XYZ","b_","OKLab","LMStoXYZ","OKLabtoLMS","LMSnl","gammaAdjustSRGB","companded","rgb2xyz","MtxRGB2XYZ","rgb2oklab","xyz","XYZ_to_OKLab","XYZ","XYZtoLMS","LMStoOKLab","LMS","sin","cos","lch2lab","h","oklch2rgb","sqrt","atan2","round","lab2lch","rgb2oklch","MediaModal","statusID","carouselRef","currentIndex","setCurrentIndex","carouselFocusItem","useLayoutEffect","scrollIntoView","prevStatusID","scrollLeft","clientWidth","differentStatusID","scrollTo","isRTL","behavior","showControls","setShowControls","handleSwipe","addEventListener","removeEventListener","handleScroll","abs","passive","mediaOkColors","media","blurhash","averageColor","getBlurHashAverageColor","mediaAccentColors","okColor","light","dark","default","mediaAccentGradients","range","join","lightGradient","darkGradient","toastRef","hideToast","currentColor","$meta","metaColor","mediaColor","colorScheme","content","accentColor","description","showMediaAlt","CATEGORIES","CATEGORIES_INFO","spam","legal","violation","stampLabel","other","excludeStamp","ReportModal","split","rules","currentDomain","getCurrentInstance","selectedCategory","setSelectedCategory","showRules","setShowRules","rulesRef","hasRules","setHasRules","previewMode","useAvatarStatic","showActivity","Object","fromEntries","category","comment","forward","ruleIds","reports","accountId","statusIds","Fragment","rule","maxlength","rows","LZString","f","keyStrBase64","keyStrUriSafe","baseReverseDic","getBaseValue","alphabet","character","input","res","compressed","uncompressed","buf","TotalLen","current_value","bitsPerChar","getCharFromInt","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data","context_data_val","context_data_position","ii","resetValue","getNextValue","dictionary","enlargeIn","dictSize","numBits","w","bits","resb","maxpower","power","module","floatingButtonUrl","multiColumnUrl$1","tabMenuBarUrl","MAX_FETCH","fetchFollowedTags","iterator","followedTags","tags","fetchCount","getFollowedTags","fauxDiv","extractTagsFromStatus","hashtagLinks","AsyncText","setText","Promise","then","SHORTCUTS_LIMIT","TYPES","TYPE_TEXT","public","bookmarks","favourites","hashtag","trending","mentions","TYPE_PARAMS","notRequired","placeholder","pattern","fetchAccountTitle","SHORTCUTS_META","excludeViewMode","subtitle","query","encodeURIComponent","ShortcutsSettings","shortcuts","showForm","setShowForm","showImportExport","setShowImportExport","shortcutsListParent","opacity","textTransform","imgURL","multiColumnUrl","shortcutsViewMode","Boolean","shortcut","excludedViewMode","includes","shortcutsArr","from","temp","shortcutIndex","justifyContent","alignItems","currentTarget","ShortcutForm","mode","ImportExport","FORM_NOTES","currentType","setCurrentType","setFollowedHashtags","form","formRef","switch","followedHashtags","autocorrect","autocapitalize","tag","shortcutsStr","compressToEncodedURIComponent","importShortcutStr","setImportShortcutStr","parsedImportShortcutStr","setImportUIState","parsed","JSON","decompressFromEncodedURIComponent","hasCurrentSettings","shortcutsImportFieldRef","v","dt","s","importUIState","menuFooter","nonUniqueShortcuts","exceededLimit","newShortcuts","writeText","share","settingsJSON","newNote","changes","prevValue","Modals","navigate","useNavigate","preload","ComposeSuspense","__COMPOSE__","editStatus","newStatus","reloadStatusPage","reply","edit","toast","prevLocation","showSettings","showAccounts","showAccount","destination","showDrafts","showMediaModal","contains","showShortcutsSettings","showEmbedModal","showReportModal","FollowRequestButtons","requestState","setRequestState","hasRelationship","followRequests","authorize","Error","NOTIFICATION_ICONS","severed_relationships","moderation_warning","emoji_reaction","emojiText","emoji","emoji_url","staticUrl","emojiObject","CustomEmoji","contentText","count","postsCount","postType","Subject","clickable","3","poll-self","poll-voted","favourite+reblog","admin.sign_up","admin.report","targetAccount","SEVERED_RELATIONSHIPS_TEXT","account_suspension","targetName","domain_block","user_domain_block","MODERATION_WARNING_TEXT","none","disable","mark_statuses_as_sensitive","delete_statuses","sensitive","silence","suspend","AVATARS_LIMIT","Notification","isStatic","disableContextMenu","report","_ids","_accounts","_statuses","_groupKeys","sampleAccounts","notificationsCount","groupKey","actualStatus","actualStatusID","isVoted","voted","isReplyToOthers","inReplyToAccountId","favsCount","reblogsCount","props","handleOpenGenericAccounts","showAvatar","emojiURL","shortcode","formattedCreatedAt","toLocaleString","genericAccountsHeading","statusKey","diffCount","expandAccounts","_g","isOwnPost","isFiltered","filtered","type2","gKey","keyAccounts","keyAccount","_accounts2","status2","TruncatedLink","onContextMenu","dispatchEvent","clientX","clientY","useTruncated","oldProps","newProps","accessToken","NotificationService","routeNotification","showNotificationSheet","notificationAccount","hasAccount","hash","warn","id2","setShowNotificationSheet","tagName","instanceURL","SearchForm","forwardRef","searchParams","setSearchParams","useSearchParams","searchMenuOpen","setSearchMenuOpen","setQuery","searchFieldRef","useImperativeHandle","setValue","select","blur","autocomplete","spellCheck","onSearch","onFocus","onBlur","onKeyDown","focusItem","nextItem","nextElementSibling","parentElement","firstItem","prevItem","previousElementSibling","lastItem","click","queryType","SearchCommand","showSearch","setShowSearch","searchFormRef","isSearchPage","closeSearch","enableOnFormTags","Shortcuts","isMultiColumnMode","shortcutsColumnsMode","menuRef","hasLists","formattedShortcuts","pin","handler","closeMenu","updatesButton","instanceRef","overflow","viewScroll","menuClassName","position","SubMenu2","groupBoosts","newValues","boostStash","serialBoosts","item","boostStashID","items","half","floor","slice","dedupeBoosts","boostedStatusIDs","filteredItems","boosterID","groupContext","contexts","contextIndex","t","repliedItem","self","inReplyToId","firstItemAccountID","newItems","appliedContextIndices","inReplyToIds","contextItems","aDate","bDate","every","it","sKey","statusReply","queueMicrotask","fallbackFetch","fetchStatus","saveStatus","skipThreading","ids","replyToStatuses","assignFollowedTags","statusFollowedTags","statusWithFollowedTags","extractedTags","itemFollowedTags","useScroll","scrollableRef","distanceFromStart","distanceFromEnd","scrollThresholdStart","scrollThresholdEnd","direction","distanceFromStartPx","_distanceFromStartPx","distanceFromEndPx","_distanceFromEndPx","scrollDirection","setScrollDirection","reachStart","setReachStart","reachEnd","setReachEnd","nearReachStart","setNearReachStart","nearReachEnd","setNearReachEnd","isVertical","scrollableElement","previousScrollStart","scrollTop","onScroll","scrollHeight","scrollWidth","clientHeight","scrollStart","scrollDimension","clientDimension","scrollDistance","init","Event","useScrollFn","useThrottledCallback","MediaPost","onMediaClick","accountEmojis","repliesCount","reblogged","favourited","favouritesCount","bookmarked","muted","visibility","language","editedAt","card","uri","_deleted","_pinned","debugHover","filterContext","useContext","FilterContext","filterInfo","hasSpoiler","readingExpandMedia","mediaKey","toLowerCase","filterTitleStr","Media","showSpoilerMedia","NavMenu","showFollowing","bindLongPress","useLongPress","threshold","detect","cancelOnMovement","buttonRef","menuState","setMenuState","boundingBoxPadding","safeBoundingBoxPadding","mutesIterator","fetchMutes","mutes","blocksIterator","fetchBlocks","blocks","supportsLists","buttonClickTS","squircle","ControlledMenu","anchorRef","containerProps","zIndex","portal","body","unmountOnClose","appVersion","commitHash","__COMMIT_HASH__","confirm","scrollIntoViewOptions","block","inline","Timeline","titleComponent","emptyText","errorText","useItemID","fetchItems","checkForUpdatesInterval","headerStart","headerEnd","timelineStart","refresh","view","showFollowedTags","showReplyParent","clearWhenRefresh","setItems","showNew","setShowNew","debug","isMediaFirstInstance","mediaFirst","allowGrouping","loadItemsTS","firstLoad2","loadItems","useDebouncedCallback","ts","otherPosts","pinnedPosts","items2","itemsSelector","jRef","activeItem","activeItemRect","closest","allItems","activeItemIndex","indexOf","itemRect","topmostItem","kRef","findLast","oRef","handleLoadNewPosts","showNewPostsIndicator","dotRef","headerRef","nearReachStart2","hiddenUI","prevView","disableIdleCheck","loadOrCheckUpdates","inBackground","noPointers","__IDLE__","visible2","hasUpdate","lastHiddenTime","TimelineItem","skeleton","inView","fItems","filteredItemsIDs","aFiltered","bFiltered","isCarousel","unfiltered","filteredItems2","has","StatusCarousel","_pinned2","_grouped","item2","statusID3","_pinned3","actualStatusID3","reblog3","statusID2","actualStatusID2","reblog2","url2","showCompact","_differentAuthor","isSpoiler","manyItems","isMiddle","isStart","isEnd","TimelineStatusCompact","itemKey","enableCommentHint","endButtonRef","render","setRender","newID","oldID","startButtonRef","statusPeekText","statusPeek","statusThreadNumber","titlesStr","MIN_YEAR","MIN_YEAR_MONTH","supportsInputMonth","setAttribute","_isSearchEnabled","isSearchEnabled","AccountStatuses","useParams","month","excludeReplies","excludeBoosts","tagged","accountStatusesIterator","allSearchParams","searchOffsetRef","searchEnabled","setSearchEnabled","isValidMonth","_year","_month","monthIndex","after","afterStr","before","beforeStr","searchResults","value2","offset","pinnedStatuses","pinnedStatusesIds","postId","setFeaturedTags","acctDisplay","accountDisplay","featuredTags","monthYear","fetchAccountPromiseRef","useTitle","fetchPromise","cachedAccount","filterBarRef","TimelineStart","year","month2","date","validity","MonthPicker","active","allowSwitch","offsetLeft","fetchAccountStatuses","masto2","monthFieldRef","yearFieldRef","checkValidity","minYear","minMonth","maxYear","maxMonth","Bookmarks","bookmarksIterator","fetchBookmarks","catchupUrl","FILTER_CONTEXT","RANGES","FILTER_KEYS","original","groups","FILTER_SORTS","FILTER_GROUPS","DTF","mem","Intl","DateTimeFormat","day","hour","minute","Catchup","dtf","showTopLinks","setShowTopLinks","supportsPixelfed","fetchHome","maxCreatedAt","maxCreatedAtDate","allResults","mainloop","homeIterator","nextParams","createdAtDate","selfPost","addedResults","catchupRangeRef","catchupLastRef","handleCatchupClick","catchupID","catchup","posts","setPosts","reloadCatchups","setLastCatchupEndAt","prevCatchups","setPrevCatchups","lastCatchupEndAt","catchups","ownCatchups","trimmedCatchups","lastCatchups","restCatchups","endAt","startAt","reloadCatchupsCount","_followedTags","_e","thePost","__FILTER","links","sharers","links2","link","topLinks","shared","linksLoop","likes","filteredPosts","authors","authorCounts","selectedFilterCategory","filteredPosts2","setSelectedAuthor","sortBy","authorsHash","setSortOrder","authorCountsMap","postFilterMatches","boostedPosts","__BOOSTERS","selectedAuthor","filteredPostsMap","authorID","authorCountsList","sortedFilteredPosts","aAccountID","authorIndices","bAccountID","aIndex","bIndex","postDensity","bDensity","aDensity","sortOrder","groupBy","prevGroup","authorsListParent","autoAnimated","isFiltered2","postsBar","postsBarType","posts2","postsBins","binByTime","lastCatchupRange","sortOrderIndex","authorElement","scrollableRect","authorRect","right","showHelp","setShowHelp","hlRef","_2","escRef","handleArrowKeys","ignoreModifiers","activeElement","isRadio","isArrowKeys","setRange","niceDateTime","format","pc","yes","st","del","setSelectedFilterCategory","setSortBy","formatRange","setGroupBy","transform","imageDescription","publishedAt","labAverageColor","filterCounts","author","paddingInline","showSeparator","IntersectionPostLineItem","isFollowedTags","PostLine","isReplyTo","show","setShow","IntersectionObserver","unobserve","MEDIA_DENSITY","CARD_DENSITY","pollContent","cur","htmlContentLength","PostPeek","density","isThread","_thread","readingExpandSpoilers","showMedia","showPostContent","emojifyText","o","multiple","remoteMediaURL","_f","_h","_j","_i","mediaURL","MEDIA_SIZE","previewUrl","gifv","video","audio","PostStats","numBins","dates","minDate","normalized","binIndex","bins","Favourites","favouritesIterator","fetchFavourites","FILTER_CONTEXT_UNIMPLEMENTED","FILTER_CONTEXT_LABELS","home","thread","EXPIRY_DURATIONS","EXPIRY_DURATIONS_LABELS","Filters","showFiltersAddEditModal","setShowFiltersAddEditModal","filters","setFilters","keywords","expiresAt","keyword","ExpiryStatus","_id","incID","FiltersAddEdit","filterAction","hasExpiry","expiresAtDate","editKeywords","setEditKeywords","keywordsRef","setRemovedKeyword_IDs","filteredEditKeywords","setRemovedKeywordIDs","removedKeyword_IDs","title2","keywordIDs","getAll","keywordKeywords","keywordWholeWords","wholeWord","removedKeywordIDs","keywordsAttributes","context2","expiresIn","filterResult","filterAction2","_id2","showNeverExpires","expired","rerender","FollowedHashtags","Following","latestItem","__BENCHMARK","latestItemChanged","clearFollowedTagsState","opts","payload","TAGS_LIMIT_PER_MODE","TOTAL_TAGS_LIMIT","Hashtags","mediaView","columnMode","hashtags","linkParams","hashtagTitle","maxID","fetchHashtags","timelines","any","maxId","onlyMedia","since_id","valueContainsLatestItem","followUIState","setFollowUIState","reachLimit","featuredUIState","setFeaturedUIState","isFeaturedTag","featuredTags2","setIsFeaturedTag","finally","featuredTagID","catch","MenuHeader","delete","FocusableItem","newHashtag","MenuGroup","exists","newInstance","List","listIterator","setList","showManageMembersModal","setShowManageMembersModal","list2","setDownOverflow","ListManageMembers","MEMBERS_LIMIT","members","setMembers","membersIterator","fetchMembers","member","as","RemoveAddButton","removed","setRemoved","notificationTypeKeys","GROUP_TYPES","groupable","fixNotifications","massageNotifications2","notificationGroups","sampleAccountIds","statusId","groupNotifications2","groupNotifications","newGroupNotifications","gn","latestPageNotificationAt","mostRecentNotificationId","newGroupNotifications1","notificationsMap","virtualType","mappedNotification","ma","mappedAccount","newGroupNotifications2","notificationsMap2","hasOneAccount","toLocaleDateString","n","cleanNotifications","cleanNotifications2","emptySearchParams","URLSearchParams","Mentions","stateType","setStateType","mentionsIterator","fetchMentions","types","conversationsIterator","latestConversationItem","lastStatus","fetchConversations","NOTIFICATIONS_LIMIT","NOTIFICATIONS_GROUPED_LIMIT","memSupportsGroupedNotifications","mastoFetchNotifications","getGroupedNotifications","NOTIFICATIONS_POLICIES","NOTIFICATIONS_POLICIES_TEXT","forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts","Notifications","notificationID","notificationAccessToken","onlyMentions","setOnlyMentions","setFollowRequests","announcements","setAnnouncements","excludeTypes","allNotifications","groupedNotifications","notificationsLastFetchTime","fetchFollowRequests","loadFollowRequests","requests","fetchAnnouncements","supportsFilteredNotifications","showNotificationsSettings","setNotificationsPolicy","fetchNotificationsPolicy","loadNotificationsPolicy","notificationsRequests","setNotificationsRequests","fetchNotificationsRequest","loadNotifications","fetchNotificationsPromise","fetchNotifications","loadUpdates","unsub","subscribeKey","yesterdayDate","todayDate","currentDay","showTodayEmpty","announcementsListRef","statusLink","today","todaySubHeading","forceOpts","setShowNotificationsSettings","announcement","AnnouncementBlock","notificationsPolicy","onToggle","open","request","NotificationRequestModalButton","NotificationRequestButtons","differentDay","notificationDay","toDateString","subHeading","weekday","newPolicy","contact","contactAccount","startsAt","endsAt","published","reactions","allDay","read","publishedAtDate","publishedDateText","updatedAtText","reaction","me","fetchNotficationsByAccount","setShowModal","showModal","setNotifications","notifs","hasRequestState","Public","isLocal","publicIterator","fetchPublic","remote","prompt","SHORT_LIMIT","Search","offsetRef","statusResults","setStatusResults","accountResults","setAccountResults","hashtagResults","setHashtagResults","setTypeResultsFunc","loadResults","filterBarParent","history","reduce","TREND_CACHE_TIME","fetchLinks","trends","fetchTrendsStatuses","pixelfed","discover","fetchLinkList","Trending","setHashtags","setLinks","trendIterator","fetchTrends","currentLinkMentionsLoading","setCurrentLinkMentionsLoading","currentLinkMentionsIterator","currentLink","setCurrentLink","supportsTrendingLinkPosts","currentLinkRef","hasCurrentLink","fetchLinkMentions","prevCurrentLink","authorUrl","authorName","providerName","providerUrl","isShortTitle","hasAuthor","flexShrink","textAlign","Columns","Hashtag","Component","$column","currentFocusedColumn","prevColKey","nextColKey","Home","NotificationsLink","notificationLinkRef","NotificationsMenu","NOTIFICATIONS_DISPLAY_LIMIT","hasFollowRequests","setHasFollowRequests","statusPostRegexes","getInstanceStatusObject","regex","match","getInstanceStatusURL","HttpRoute","statusObject","statusURL","Lists","instancesListURL","dec2hex","dec","toString","verifier","array","Uint32Array","crypto","getRandomValues","sha256","plain","TextEncoder","encode","subtle","digest","base64urlencode","bytes","len","byteLength","String","fromCharCode","btoa","generateCodeChallenge","hashed","supportsPKCE","ok","json","code_challenge_methods_supported","__generateCodeChallenge","DEV","PHANPY_CLIENT_NAME","CLIENT_NAME","SCOPES","sameSite","currentLocation","origin","REDIRECT_URI","registerApplication","registrationParams","client_name","redirect_uris","scopes","website","method","headers","getPKCEAuthorizationURL","registrationJSON","client_id","codeChallenge","code_challenge_method","code_challenge","authorizationParams","scope","authorizationURL","client_secret","code_verifier","redirect_uri","append","PHANPY_DEFAULT_INSTANCE","DEFAULT_INSTANCE","Login","instanceURLRef","cachedInstanceURL","submit","instanceText","setInstanceText","instancesList","setInstancesList","searcher","Fuse","submitInstance","xmlDoc","parseFromString","template","vapid_key","authPKCE","sessionCookie","getAuthorizationURL","cleanInstanceText","instanceTextLooksLikeDomain","instancesSuggestions","instance2","selectedInstanceText","SUBCOMMENTS_OPEN_ALL_LIMIT","MAX_WEIGHT","cachedRepliesToggle","cachedStatusesMap","scrollPositions","resetScrollPosition","STATUSES_SELECTOR","STATUS_URL_REGEX","StatusPage","mediaParam","mediaOnlyParam","mediaIndex","mediaStatusID","mediaStatus","getStatus","showMediaOnly","heroStatus","setHeroStatus","closeLink","matchStatusPath","matchPath","handleMediaClose","$carousel","$deckContainers","$deckContainer","StatusParent","linkable","restProps","createdAtSort","StatusThread","navigation","translate","setStatuses","heroStatusRef","totalDescendants","scrollOffsets","lastInitContextTS","reloadHero","heroTimer","cachedStatuses","reallyCachedStatuses","heroFetch","pRetry","contextFetch","hasStatus","heroStatus2","_replies","level","nextLevel","descendantLevelsCount","expandReplies","_r","weight","descendants","ancestors2","ancestors","missingStatuses","ancestorsIsThread","nestedDescendants","__replies","heroAccountID","ancestor","threadifyStatus","offsetTop","heroLimit","setLimit","showRefresh","setShowRefresh","allStatuses","scrollPosition","initContext","interval","newScrollOffsets","contextURL","newScrollTop","statusWeightCache","heroContentText","apiCache","heroDisplayName","postInstance","hasDescendants","div","innerHTML","activeStatusRect","activeStatus","postSameInstance","nextStatus","allStatusLinks","activeStatusIndex","some","heroPointer","topmostStatusLink","heroInView","prevStatus","statusLinkRect","details","initialPageState","handleMediaClick","handleStatusLinkClick","descendant","isHero","requestAnimationFrame","setHeroInView","setReachTopPost","isLinkable","SubComments","enableTranslate","onStatusLinkClick","showActionsBar","prevLocationIsStatusPage","prevEntry","hasParentThread","openAll","getIDs","statusesList","renderStatus","spoilerButton","viewMode","moreStatusesKeys","onAnimationEnd","back","reachTopPost","arr","setViewMode","button","full","buttons","accWeight","parentLink","diveDeep","replies3","totalComments","sameCount","totalWeight","calcStatusWeight","openBefore","renderReplies","Container","isDetails","detailsRef","shortReply","open2","dataset","setRenderReplies","MEDIA_VIRTUAL_LENGTH","CARD_VIRTUAL_LENGTH","cachedWeight","mediaLength","pollLength","POLL_VIRTUAL_LENGTH","cardLength","StatusRoute","boostsCarouselUrl","groupedNotificationsUrl","multiHashtagTimelineUrl","nestedCommentsThreadUrl","logoText","PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL","DEFAULT_INSTANCE_REGISTRATION_URL","appSite","Welcome","marginBlockEnd","nativeAlert","__nativeAlert","Toastify","gravity","__STATES__","__STATES_STATS__","counts","unmountedPosts","setInterval","unfurledLinks","postInNotifications","$post","unfurled","keysCount","ICONS","nonIdleEvents","setIdle","debouncedSetIdle","onNonIdle","isIOS","tempColor","themeDarkColor","textSize","$app","BENCHES","setIsLoggedIn","decodeURIComponent","clientSecret","clientID","initStates","searchAccount","getAccount","client","hasPreferences","hasInstance","initPreferences","initInstance","PrimaryRoutes","Routes","Route","Root","nonRootLocation","getPrevLocation","SecondaryRoutes","backgroundLocation","isModalPage","initActivateLang","I18nProvider","HashRouter","App","localStorage","removeItem","sessionStorage","IGNORE_CACHE_KEYS","clearRanOnce","FAST_INTERVAL","SLOW_INTERVAL","clearCaches","cache","_keys","MAX_SW_CACHE_SIZE","deleteKeys"],"mappings":"0lCAAA,IAAIA,GAAmBC,GAEvB,SAASA,GAASC,EAAIC,EAAMC,EAAW,CACrC,IAAIC,EAAU,KACVC,EAAc,KAEdC,EAAQ,UAAW,CACjBF,IACF,aAAaA,CAAO,EAEpBC,EAAc,KACdD,EAAU,KAEhB,EAEMG,EAAQ,UAAW,CACrB,IAAIC,EAAOH,EACXC,IAEIE,GACFA,GAEN,EAEMC,EAAkB,UAAW,CAC/B,GAAI,CAACP,EACH,OAAOD,EAAG,MAAM,KAAM,SAAS,EAGjC,IAAIS,EAAU,KACVC,EAAO,UACPC,E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