{"version":3,"file":"compose-sBS7hMqP.js","sources":["../../src/compose.jsx"],"sourcesContent":["import './index.css';\n\nimport './app.css';\n\nimport { render } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport Compose from './components/compose';\nimport useTitle from './utils/useTitle';\n\nif (window.opener) {\n console = window.opener.console;\n}\n\nfunction App() {\n const [uiState, setUIState] = useState('default');\n\n const { editStatus, replyToStatus, draftStatus } = window.__COMPOSE__ || {};\n\n useTitle(\n editStatus\n ? 'Editing source status'\n : replyToStatus\n ? `Replying to @${\n replyToStatus.account?.acct || replyToStatus.account?.username\n }`\n : 'Compose',\n );\n\n useEffect(() => {\n if (uiState === 'closed') {\n try {\n // Focus parent window\n window.opener.focus();\n } catch (e) {}\n window.close();\n }\n }, [uiState]);\n\n if (uiState === 'closed') {\n return (\n
You may close this page now.
\n\n \n
\n