{"version":3,"sources":["config.ts","layout/Header.tsx","common/DefaultPage.tsx","common/LoadingSpinner.tsx","inject.tsx","snack/browserNotification.ts","layout/Navigation.tsx","common/ScrollUpButton.tsx","common/SettingsDialog.tsx","snack/SnackBarHandler.tsx","common/ConfirmDialog.tsx","message/extras.ts","common/CopyableSecret.tsx","common/NumberField.tsx","application/AddApplicationDialog.tsx","application/UpdateApplicationDialog.tsx","common/LastUsedCell.tsx","application/Applications.tsx","client/AddClientDialog.tsx","client/UpdateClientDialog.tsx","client/Clients.tsx","plugin/Plugins.tsx","common/Markdown.tsx","common/Container.tsx","plugin/PluginDetailView.tsx","user/Register.tsx","user/Login.tsx","message/Message.tsx","message/Messages.tsx","user/AddEditUserDialog.tsx","user/Users.tsx","common/ConnectionErrorBanner.tsx","layout/Layout.tsx","CurrentUser.ts","common/BaseStore.ts","application/AppStore.ts","message/WebSocketStore.ts","snack/SnackManager.ts","user/UserStore.ts","message/MessagesStore.ts","client/ClientStore.ts","plugin/PluginStore.ts","reactions.ts","index.tsx","apiAuth.ts","registerServiceWorker.ts"],"names":["config","url","register","version","commit","buildDate","window","get","key","Header","observer","this","props","classes","name","loggedIn","admin","toggleTheme","logout","style","setNavOpen","width","position","AppBar","className","appBar","Toolbar","toolbar","title","to","link","Typography","variant","titleName","color","href","renderButtons","IconButton","onClick","target","rel","showSettings","menuButtons","Hidden","smUp","implementation","icon","label","id","Component","ResponsiveButton","rest","Button","startIcon","withWidth","withStyles","theme","createStyles","zIndex","drawer","breakpoints","down","paddingBottom","justifyContent","flexWrap","display","flex","flexBasis","marginTop","order","up","paddingRight","textDecoration","withTheme","DefaultPage","rightControl","maxWidth","children","margin","Grid","container","spacing","item","xs","LoadingSpinner","textAlign","CircularProgress","size","inject","stores","node","mobxInject","InjectProvider","mayAllowPermission","Notify","needsPermission","isSupported","Notification","permission","closeAndFocus","event","parent","focus","location","close","closeAfterTimeout","setTimeout","Navigation","state","showRequestNotification","appStore","navOpen","apps","getItems","userApps","length","map","app","ListItem","button","ListItemText","primary","placeholderItems","disabled","root","paper","drawerPaper","Divider","align","requestPermission","console","log","setState","ResponsiveDrawer","Drawer","open","xsDown","height","minHeight","mixins","ScrollUpButton","opacity","scrollHandler","currentScrollPos","pageYOffset","nextState","Math","min","scrollUp","scrollTo","addEventListener","removeEventListener","Fab","bottom","right","SettingsDialog","pass","fClose","currentUser","Dialog","onClose","DialogTitle","DialogContent","TextField","autoFocus","type","value","onChange","e","fullWidth","DialogActions","Tooltip","changePassword","observable","SnackBarHandler","dispose","componentDidMount","reaction","snackManager","counter","onNewSnack","componentWillUnmount","openWhen","snackOpenSince","Date","now","MIN_VISIBLE_SNACK_TIME_IN_MS","closeCurrentSnack","openNextSnack","hasNext","next","current","message","duration","MAX_VISIBLE_SNACK_TIME_IN_MS","Snackbar","anchorOrigin","vertical","horizontal","autoHideDuration","onExited","action","ConfirmDialog","text","fOnSubmit","DialogContentText","RenderMode","CopyableSecret","visible","toggleVisibility","copyToClipboard","a","navigator","clipboard","writeText","snack","error","fontFamily","fontSize","NumberField","React","useState","toString","stringValue","setStringValue","setError","helperText","i","parseInt","Number","isNaN","AddDialog","description","defaultPriority","submitEnabled","handleChange","bind","multiline","propertyName","UpdateDialog","initialName","initialDescription","initialDefaultPriority","LastUsedCell","lastUsed","date","Applications","uploadId","upload","refresh","uploadImage","click","onUploadImage","file","files","indexOf","alert","createDialog","deleteId","updateId","Paper","elevation","Table","TableHead","TableRow","TableCell","padding","TableBody","image","token","fUpload","fDelete","fEdit","noDelete","internal","ref","create","update","getByID","remove","Row","src","alt","alignItems","placement","Clients","clientStore","showDialog","clients","client","Plugins","pluginStore","plugins","plugin","enabled","fToggleStatus","changeEnabledState","Switch","checked","Markdown","gfm","PluginDetailView","pluginID","match","params","pluginInfo","displayText","currentConfig","refreshFeatures","nextProps","Promise","all","refreshConfigurer","refreshDisplayer","capabilities","requestConfig","response","requestDisplay","Info","Build","initialConfig","save","newConfig","changeConfig","Subject","PanelWrapper","Icon","float","toLowerCase","trim","replace","ConfigurerPanel","unsavedChanges","options","mode","lineNumbers","_","_1","newConf","then","DisplayerPanel","PluginInfo","author","modulePath","website","license","join","RegistrationDialog","namePresent","passPresent","success","Login","login","preventDefault","username","password","registerButton","registerDialog","onSubmit","autoComplete","connectionErrorMessage","marginBottom","contentType","extras","extract","Object","keys","k","some","Plain","path","priorityColor","priority","Message","getBoundingClientRect","renderContent","content","plainContent","wrapperPadding","borderLeftColor","borderLeftWidth","borderLeftStyle","imageWrapper","messageContentWrapper","header","headerTitle","trash","component","PureComponent","marginRight","whiteSpace","wordBreak","overflow","Messages","appId","isLoadingMore","updateAllWithProps","messagesStore","exists","loadMore","updateAll","deleteMessage","removeSingle","renderMessage","heights","gutterBottom","onscroll","innerHeight","document","body","offsetHeight","checkIfLoadMore","messages","hasMore","canLoadMore","getName","hasMessages","refreshByApp","deleteAll","useWindowAsScrollContainer","preloadBatchSize","elementHeight","m","removeByApp","undefined","AddEditDialog","isEdit","FormControlLabel","control","handleChecked","UserRow","Users","userStore","editId","users","user","wrapper","ConnectionErrorBanner","retry","backgroundColor","lineHeight","localStorageThemeKey","themeMap","light","createMuiTheme","palette","dark","Layout","localStorageTheme","localStorage","getItem","currentTheme","setItem","authenticating","tryReconnect","flexDirection","CssBaseline","top","exact","render","tokenKey","CurrentUser","tokenCache","reconnectTimeoutId","reconnectTime","localStorageToken","setToken","axios","post","catch","data","errorDescription","browser","detect","request","method","headers","Authorization","Base64","encode","resp","tryAuthenticate","reject","passThrough","status","connectionError","statusText","filter","forEach","delete","resolve","removeItem","quiet","clearTimeout","BaseStore","getByIDOrUndefined","Error","items","find","hasId","requestDelete","requestItems","AppStore","onDelete","formData","FormData","append","put","WebSocketStore","wsActive","ws","listen","callback","wsUrl","WebSocket","onerror","onmessage","JSON","parse","onclose","SnackManager","shift","push","UserStore","AllMessages","MessagesStore","loading","stateOf","emptyState","loaded","clear","fetchMessages","since","getUnCached","appToImage","reduce","appid","createTransformer","clearCache","createEmptyStatesForApps","array","nextSince","messageToDelete","index","findIndex","splice","pagedResult","paging","unshift","clearAll","removeFromList","ClientStore","createNoNotifcation","PluginStore","registerReactions","wsStore","loadAll","msg","publishSingleMessage","removeMarkdown","silent","notifyClick","notifyShow","show","Audio","play","port","hostname","protocol","pathname","slashes","concat","endsWith","substring","lastIndexOf","prodUrl","initStores","interceptors","use","onbeforeunload","ReactDOM","getElementById","serviceWorker","ready","registration","unregister"],"mappings":"mLAeMA,EAAe,aACjBC,IAAK,QACLC,UAAU,EACVC,QAAS,CAACC,OAAQ,UAAWC,UAAW,UAAWF,QAAS,YACzDG,OAAON,QAOP,SAASO,EAA6BC,GACzC,OAAOR,EAAOQ,G,2ZCqDZC,GADLC,Y,8JAEG,WACI,MAWIC,KAAKC,MAVLC,EADJ,EACIA,QACAV,EAFJ,EAEIA,QACAW,EAHJ,EAGIA,KACAC,EAJJ,EAIIA,SACAC,EALJ,EAKIA,MACAC,EANJ,EAMIA,YACAC,EAPJ,EAOIA,OACAC,EARJ,EAQIA,MACAC,EATJ,EASIA,WACAC,EAVJ,EAUIA,MAGEC,EAAqB,OAAVD,EAAiB,SAAW,QAE7C,OACI,eAACE,EAAA,EAAD,CAAQD,SAAUA,EAAUH,MAAOA,EAAOK,UAAWX,EAAQY,OAA7D,SACI,gBAACC,EAAA,EAAD,CAASF,UAAWX,EAAQc,QAA5B,UACI,uBAAKH,UAAWX,EAAQe,MAAxB,UACI,eAAC,IAAD,CAAMC,GAAG,IAAIL,UAAWX,EAAQiB,KAAhC,SACI,eAACC,EAAA,EAAD,CAAYC,QAAQ,KAAKR,UAAWX,EAAQoB,UAAWC,MAAM,UAA7D,sBAIJ,oBACIC,KAAM,kDAAoDhC,EAC1DqB,UAAWX,EAAQiB,KAFvB,SAGI,gBAACC,EAAA,EAAD,CAAYC,QAAQ,SAASE,MAAM,UAAnC,cACM/B,UAIbY,GAAYJ,KAAKyB,cAActB,EAAME,EAAOE,EAAQG,EAAOD,GAC5D,iCACI,eAACiB,EAAA,E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+T,SAAS6K,eAAe,SExExB,kBAAmBjX,WACnBA,UAAUkX,cAAcC,MAAMpP,MAAK,SAACqP,GAChCA,EAAaC,gBFgDzB,K","file":"static/js/main.f445756e.chunk.js","sourcesContent":["import {IVersion} from './types';\n\nexport interface IConfig {\n url: string;\n register: boolean;\n version: IVersion;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n interface Window {\n config?: Partial;\n }\n}\n\nconst config: IConfig = {\n url: 'unset',\n register: false,\n version: {commit: 'unknown', buildDate: 'unknown', version: 'unknown'},\n ...window.config,\n};\n\nexport function set(key: Key, value: IConfig[Key]): void {\n config[key] = value;\n}\n\nexport function get(key: K): IConfig[K] {\n return config[key];\n}\n","import AppBar from '@material-ui/core/AppBar';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport {createStyles, Theme, WithStyles, withStyles} from '@material-ui/core/styles';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport AccountCircle from '@material-ui/icons/AccountCircle';\nimport Chat from '@material-ui/icons/Chat';\nimport DevicesOther from '@material-ui/icons/DevicesOther';\nimport ExitToApp from '@material-ui/icons/ExitToApp';\nimport Highlight from '@material-ui/icons/Highlight';\nimport GitHubIcon from '@material-ui/icons/GitHub';\nimport MenuIcon from '@material-ui/icons/Menu';\nimport Apps from '@material-ui/icons/Apps';\nimport SupervisorAccount from '@material-ui/icons/SupervisorAccount';\nimport React, {Component, CSSProperties} from 'react';\nimport {Link} from 'react-router-dom';\nimport {observer} from 'mobx-react';\nimport {Hidden, PropTypes, withWidth} from '@material-ui/core';\nimport {Breakpoint} from '@material-ui/core/styles/createBreakpoints';\n\nconst styles = (theme: Theme) =>\n createStyles({\n appBar: {\n zIndex: theme.zIndex.drawer + 1,\n [theme.breakpoints.down('xs')]: {\n paddingBottom: 10,\n },\n },\n toolbar: {\n justifyContent: 'space-between',\n [theme.breakpoints.down('xs')]: {\n flexWrap: 'wrap',\n },\n },\n menuButtons: {\n display: 'flex',\n [theme.breakpoints.down('sm')]: {\n flex: 1,\n },\n justifyContent: 'center',\n [theme.breakpoints.down('xs')]: {\n flexBasis: '100%',\n marginTop: 5,\n order: 1,\n justifyContent: 'space-between',\n },\n },\n title: {\n [theme.breakpoints.up('md')]: {\n flex: 1,\n },\n display: 'flex',\n alignItems: 'center',\n },\n titleName: {\n paddingRight: 10,\n },\n link: {\n color: 'inherit',\n textDecoration: 'none',\n },\n });\n\ntype Styles = WithStyles<'link' | 'menuButtons' | 'toolbar' | 'titleName' | 'title' | 'appBar'>;\n\ninterface IProps extends Styles {\n loggedIn: boolean;\n name: string;\n admin: boolean;\n version: string;\n toggleTheme: VoidFunction;\n showSettings: VoidFunction;\n logout: VoidFunction;\n style: CSSProperties;\n width: Breakpoint;\n setNavOpen: (open: boolean) => void;\n}\n\n@observer\nclass Header extends Component {\n public render() {\n const {\n classes,\n version,\n name,\n loggedIn,\n admin,\n toggleTheme,\n logout,\n style,\n setNavOpen,\n width,\n } = this.props;\n\n const position = width === 'xs' ? 'sticky' : 'fixed';\n\n return (\n \n \n
\n \n \n Gotify\n \n \n \n \n @{version}\n \n \n
\n {loggedIn && this.renderButtons(name, admin, logout, width, setNavOpen)}\n
\n \n \n \n\n \n \n \n \n \n
\n
\n
\n );\n }\n\n private renderButtons(\n name: string,\n admin: boolean,\n logout: VoidFunction,\n width: Breakpoint,\n setNavOpen: (open: boolean) => void\n ) {\n const {classes, showSettings} = this.props;\n return (\n
\n \n }\n onClick={() => setNavOpen(true)}\n label=\"menu\"\n width={width}\n color=\"inherit\"\n />\n \n {admin && (\n \n }\n label=\"users\"\n width={width}\n color=\"inherit\"\n />\n \n )}\n \n } label=\"apps\" width={width} color=\"inherit\" />\n \n \n }\n label=\"clients\"\n width={width}\n color=\"inherit\"\n />\n \n \n }\n label=\"plugins\"\n width={width}\n color=\"inherit\"\n />\n \n }\n label={name}\n onClick={showSettings}\n id=\"changepw\"\n width={width}\n color=\"inherit\"\n />\n }\n label=\"Logout\"\n onClick={logout}\n id=\"logout\"\n width={width}\n color=\"inherit\"\n />\n
\n );\n }\n}\n\nconst ResponsiveButton: React.FC<{\n width: Breakpoint;\n color: PropTypes.Color;\n label: string;\n id?: string;\n onClick?: () => void;\n icon: React.ReactNode;\n}> = ({width, icon, label, ...rest}) => {\n if (width === 'xs' || width === 'sm') {\n return {icon};\n }\n return (\n \n );\n};\n\nexport default withWidth()(withStyles(styles, {withTheme: true})(Header));\n","import Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, {FC} from 'react';\n\ninterface IProps {\n title: string;\n rightControl?: React.ReactNode;\n maxWidth?: number;\n}\n\nconst DefaultPage: FC = ({title, rightControl, maxWidth = 700, children}) => (\n
\n \n \n \n {title}\n \n {rightControl}\n \n {children}\n \n
\n);\nexport default DefaultPage;\n","import CircularProgress from '@material-ui/core/CircularProgress';\nimport Grid from '@material-ui/core/Grid';\nimport React from 'react';\nimport DefaultPage from './DefaultPage';\n\nexport default function LoadingSpinner() {\n return (\n \n \n \n \n \n );\n}\n","import * as React from 'react';\nimport {UserStore} from './user/UserStore';\nimport {SnackManager} from './snack/SnackManager';\nimport {MessagesStore} from './message/MessagesStore';\nimport {CurrentUser} from './CurrentUser';\nimport {ClientStore} from './client/ClientStore';\nimport {AppStore} from './application/AppStore';\nimport {inject as mobxInject, Provider} from 'mobx-react';\nimport {WebSocketStore} from './message/WebSocketStore';\nimport {PluginStore} from './plugin/PluginStore';\n\nexport interface StoreMapping {\n userStore: UserStore;\n snackManager: SnackManager;\n messagesStore: MessagesStore;\n currentUser: CurrentUser;\n clientStore: ClientStore;\n appStore: AppStore;\n pluginStore: PluginStore;\n wsStore: WebSocketStore;\n}\n\nexport type AllStores = Extract;\nexport type Stores = Pick;\n\nexport const inject =\n (...stores: I[]) =>\n // eslint-disable-next-line @typescript-eslint/ban-types\n

(\n node: React.ComponentType

\n ): React.ComponentType>> =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mobxInject(...stores)(node) as any;\n\nexport const InjectProvider: React.FC<{stores: StoreMapping}> = ({children, stores}) => (\n {children}\n);\n","import Notify from 'notifyjs';\nimport removeMarkdown from 'remove-markdown';\nimport {IMessage} from '../types';\n\nexport function mayAllowPermission(): boolean {\n return Notify.needsPermission && Notify.isSupported() && Notification.permission !== 'denied';\n}\n\nexport function requestPermission() {\n if (Notify.needsPermission && Notify.isSupported()) {\n Notify.requestPermission(\n () => console.log('granted notification permissions'),\n () => console.log('notification permission denied')\n );\n }\n}\n\nexport function notifyNewMessage(msg: IMessage) {\n const notify = new Notify(msg.title, {\n body: removeMarkdown(msg.message),\n icon: msg.image,\n silent: true,\n notifyClick: closeAndFocus,\n notifyShow: closeAfterTimeout,\n });\n notify.show();\n}\n\nfunction closeAndFocus(event: Event) {\n if (window.parent) {\n window.parent.focus();\n }\n window.focus();\n window.location.href = '/';\n const target = event.target as Notification;\n target.close();\n}\n\nfunction closeAfterTimeout(event: Event) {\n setTimeout(() => {\n const target = event.target as Notification;\n target.close();\n }, 5000);\n}\n","import Divider from '@material-ui/core/Divider';\nimport Drawer from '@material-ui/core/Drawer';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport {StyleRules, Theme, WithStyles, withStyles} from '@material-ui/core/styles';\nimport React, {Component} from 'react';\nimport {Link} from 'react-router-dom';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {mayAllowPermission, requestPermission} from '../snack/browserNotification';\nimport {Button, Hidden, IconButton, Typography} from '@material-ui/core';\nimport {DrawerProps} from '@material-ui/core/Drawer/Drawer';\nimport CloseIcon from '@material-ui/icons/Close';\n\nconst styles = (theme: Theme): StyleRules<'root' | 'drawerPaper' | 'toolbar' | 'link'> => ({\n root: {\n height: '100%',\n },\n drawerPaper: {\n position: 'relative',\n width: 250,\n minHeight: '100%',\n height: '100vh',\n },\n toolbar: theme.mixins.toolbar,\n link: {\n color: 'inherit',\n textDecoration: 'none',\n },\n});\n\ntype Styles = WithStyles<'root' | 'drawerPaper' | 'toolbar' | 'link'>;\n\ninterface IProps {\n loggedIn: boolean;\n navOpen: boolean;\n setNavOpen: (open: boolean) => void;\n}\n\n@observer\nclass Navigation extends Component<\n IProps & Styles & Stores<'appStore'>,\n {showRequestNotification: boolean}\n> {\n public state = {showRequestNotification: mayAllowPermission()};\n\n public render() {\n const {classes, loggedIn, appStore, navOpen, setNavOpen} = this.props;\n const {showRequestNotification} = this.state;\n const apps = appStore.getItems();\n\n const userApps =\n apps.length === 0\n ? null\n : apps.map((app) => (\n setNavOpen(false)}\n className={`${classes.link} item`}\n to={'/messages/' + app.id}\n key={app.id}>\n \n \n \n \n ));\n\n const placeholderItems = [\n \n \n ,\n \n \n ,\n ];\n\n return (\n \n

\n setNavOpen(false)}>\n \n \n \n \n \n
{loggedIn ? userApps : placeholderItems}
\n \n \n {showRequestNotification ? (\n {\n requestPermission();\n this.setState({showRequestNotification: false});\n }}>\n Enable Notifications\n \n ) : null}\n \n \n );\n }\n}\n\nconst ResponsiveDrawer: React.FC<\n DrawerProps & {navOpen: boolean; setNavOpen: (open: boolean) => void}\n> = ({navOpen, setNavOpen, children, ...rest}) => (\n <>\n \n \n setNavOpen(false)}>\n \n \n {children}\n \n \n \n \n {children}\n \n \n \n);\n\nexport default withStyles(styles, {withTheme: true})(inject('appStore')(Navigation));\n","import Fab from '@material-ui/core/Fab';\nimport KeyboardArrowUp from '@material-ui/icons/KeyboardArrowUp';\nimport React, {Component} from 'react';\n\nclass ScrollUpButton extends Component {\n state = {\n display: 'none',\n opacity: 0,\n };\n componentDidMount() {\n window.addEventListener('scroll', this.scrollHandler);\n }\n\n componentWillUnmount() {\n window.removeEventListener('scroll', this.scrollHandler);\n }\n\n scrollHandler = () => {\n const currentScrollPos = window.pageYOffset;\n const opacity = Math.min(currentScrollPos / 500, 1);\n const nextState = {display: currentScrollPos > 0 ? 'inherit' : 'none', opacity};\n if (this.state.display !== nextState.display || this.state.opacity !== nextState.opacity) {\n this.setState(nextState);\n }\n };\n\n public render() {\n return (\n \n \n \n );\n }\n\n private scrollUp = () => window.scrollTo(0, 0);\n}\n\nexport default ScrollUpButton;\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\nimport {observable} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\n\ninterface IProps {\n fClose: VoidFunction;\n}\n\n@observer\nclass SettingsDialog extends Component> {\n @observable\n private pass = '';\n\n public render() {\n const {pass} = this;\n const {fClose, currentUser} = this.props;\n const submitAndClose = () => {\n currentUser.changePassword(pass);\n fClose();\n };\n return (\n \n Change Password\n \n (this.pass = e.target.value)}\n fullWidth\n />\n \n \n \n \n
\n \n Change\n \n
\n
\n
\n \n );\n }\n}\n\nexport default inject('currentUser')(SettingsDialog);\n","import IconButton from '@material-ui/core/IconButton';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport Close from '@material-ui/icons/Close';\nimport React, {Component} from 'react';\nimport {observable, reaction} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\n\n@observer\nclass SnackBarHandler extends Component> {\n private static MAX_VISIBLE_SNACK_TIME_IN_MS = 6000;\n private static MIN_VISIBLE_SNACK_TIME_IN_MS = 1000;\n\n @observable\n private open = false;\n @observable\n private openWhen = 0;\n\n private dispose: () => void = () => {};\n\n public componentDidMount = () =>\n (this.dispose = reaction(() => this.props.snackManager.counter, this.onNewSnack));\n\n public componentWillUnmount = () => this.dispose();\n\n public render() {\n const {message: current, hasNext} = this.props.snackManager;\n const duration = hasNext()\n ? SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS\n : SnackBarHandler.MAX_VISIBLE_SNACK_TIME_IN_MS;\n\n return (\n {current}}\n action={\n \n \n \n }\n />\n );\n }\n\n private onNewSnack = () => {\n const {open, openWhen} = this;\n\n if (!open) {\n this.openNextSnack();\n return;\n }\n\n const snackOpenSince = Date.now() - openWhen;\n if (snackOpenSince > SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS) {\n this.closeCurrentSnack();\n } else {\n setTimeout(\n this.closeCurrentSnack,\n SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS - snackOpenSince\n );\n }\n };\n\n private openNextSnack = () => {\n if (this.props.snackManager.hasNext()) {\n this.open = true;\n this.openWhen = Date.now();\n this.props.snackManager.next();\n }\n };\n\n private closeCurrentSnack = () => (this.open = false);\n}\n\nexport default inject('snackManager')(SnackBarHandler);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport React from 'react';\n\ninterface IProps {\n title: string;\n text: string;\n fClose: VoidFunction;\n fOnSubmit: VoidFunction;\n}\n\nexport default function ConfirmDialog({title, text, fClose, fOnSubmit}: IProps) {\n const submitAndClose = () => {\n fOnSubmit();\n fClose();\n };\n return (\n \n {title}\n \n {text}\n \n \n \n \n Yes\n \n \n \n );\n}\n","import {IMessageExtras} from '../types';\n\nexport enum RenderMode {\n Markdown = 'text/markdown',\n Plain = 'text/plain',\n}\n\nexport const contentType = (extras?: IMessageExtras): RenderMode => {\n const type = extract(extras, 'client::display', 'contentType');\n const valid = Object.keys(RenderMode)\n .map((k) => RenderMode[k])\n .some((mode) => mode === type);\n return valid ? type : RenderMode.Plain;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst extract = (extras: IMessageExtras | undefined, key: string, path: string): any => {\n if (!extras) {\n return null;\n }\n\n if (!extras[key]) {\n return null;\n }\n\n if (!extras[key][path]) {\n return null;\n }\n\n return extras[key][path];\n};\n","import IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport Visibility from '@material-ui/icons/Visibility';\nimport Copy from '@material-ui/icons/FileCopyOutlined';\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\nimport React, {Component, CSSProperties} from 'react';\nimport {Stores, inject} from '../inject';\n\ninterface IProps {\n value: string;\n style?: CSSProperties;\n}\n\ninterface IState {\n visible: boolean;\n}\n\nclass CopyableSecret extends Component, IState> {\n public state = {visible: false};\n\n public render() {\n const {value, style} = this.props;\n const text = this.state.visible ? value : '•••••••••••••••';\n return (\n
\n \n \n \n \n {this.state.visible ? : }\n \n {text}\n
\n );\n }\n\n private toggleVisibility = () => this.setState({visible: !this.state.visible});\n private copyToClipboard = async () => {\n const {snackManager, value} = this.props;\n try {\n await navigator.clipboard.writeText(value);\n snackManager.snack('Copied to clipboard');\n } catch (error) {\n console.error('Failed to copy to clipboard:', error);\n snackManager.snack('Failed to copy to clipboard');\n }\n };\n}\n\nexport default inject('snackManager')(CopyableSecret);\n","import {TextField, TextFieldProps} from '@material-ui/core';\nimport React from 'react';\n\nexport interface NumberFieldProps {\n value: number;\n onChange: (value: number) => void;\n}\n\nexport const NumberField = ({\n value,\n onChange,\n ...props\n}: NumberFieldProps & Omit) => {\n const [stringValue, setStringValue] = React.useState(value.toString());\n const [error, setError] = React.useState('');\n\n return (\n {\n setStringValue(event.target.value);\n const i = parseInt(event.target.value, 10);\n if (!Number.isNaN(i)) {\n onChange(i);\n setError('');\n } else {\n setError('Invalid number');\n }\n }}\n {...props}\n />\n );\n};\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport {NumberField} from '../common/NumberField';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string, description: string, defaultPriority: number) => void;\n}\n\ninterface IState {\n name: string;\n description: string;\n defaultPriority: number;\n}\n\nexport default class AddDialog extends Component {\n public state = {name: '', description: '', defaultPriority: 0};\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name, description, defaultPriority} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name, description, defaultPriority);\n fClose();\n };\n return (\n \n Create an application\n \n \n An application is allowed to send messages.\n \n \n \n this.setState({defaultPriority: value})}\n fullWidth\n />\n \n \n \n \n
\n \n Create\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport {NumberField} from '../common/NumberField';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string, description: string, defaultPriority: number) => void;\n initialName: string;\n initialDescription: string;\n initialDefaultPriority: number;\n}\n\ninterface IState {\n name: string;\n description: string;\n defaultPriority: number;\n}\n\nexport default class UpdateDialog extends Component {\n public state = {name: '', description: '', defaultPriority: 0};\n\n constructor(props: IProps) {\n super(props);\n this.state = {\n name: props.initialName,\n description: props.initialDescription,\n defaultPriority: props.initialDefaultPriority,\n };\n }\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name, description, defaultPriority} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name, description, defaultPriority);\n fClose();\n };\n return (\n \n Update an application\n \n \n An application is allowed to send messages.\n \n \n \n this.setState({defaultPriority: value})}\n fullWidth\n />\n \n \n \n \n
\n \n Update\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import {Typography} from '@material-ui/core';\nimport React from 'react';\nimport TimeAgo from 'react-timeago';\n\nexport const LastUsedCell: React.FC<{lastUsed: string | null}> = ({lastUsed}) => {\n if (lastUsed === null) {\n return Never;\n }\n\n if (+new Date(lastUsed) + 300000 > Date.now()) {\n return Recently;\n }\n\n return ;\n};\n","import Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport CloudUpload from '@material-ui/icons/CloudUpload';\nimport React, {ChangeEvent, Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport CopyableSecret from '../common/CopyableSecret';\nimport AddApplicationDialog from './AddApplicationDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport * as config from '../config';\nimport UpdateDialog from './UpdateApplicationDialog';\nimport {IApplication} from '../types';\nimport {LastUsedCell} from '../common/LastUsedCell';\n\n@observer\nclass Applications extends Component> {\n @observable\n private deleteId: number | false = false;\n @observable\n private updateId: number | false = false;\n @observable\n private createDialog = false;\n\n private uploadId = -1;\n private upload: HTMLInputElement | null = null;\n\n public componentDidMount = () => this.props.appStore.refresh();\n\n public render() {\n const {\n createDialog,\n deleteId,\n updateId,\n props: {appStore},\n } = this;\n const apps = appStore.getItems();\n return (\n (this.createDialog = true)}>\n Create Application\n \n }\n maxWidth={1000}>\n \n \n \n \n \n \n Name\n Token\n Description\n Priority\n Last Used\n \n \n \n \n \n {apps.map((app: IApplication) => (\n this.uploadImage(app.id)}\n fDelete={() => (this.deleteId = app.id)}\n fEdit={() => (this.updateId = app.id)}\n noDelete={app.internal}\n />\n ))}\n \n
\n (this.upload = upload)}\n type=\"file\"\n style={{display: 'none'}}\n onChange={this.onUploadImage}\n />\n
\n
\n {createDialog && (\n (this.createDialog = false)}\n fOnSubmit={appStore.create}\n />\n )}\n {updateId !== false && (\n (this.updateId = false)}\n fOnSubmit={(name, description, defaultPriority) =>\n appStore.update(updateId, name, description, defaultPriority)\n }\n initialDescription={appStore.getByID(updateId).description}\n initialName={appStore.getByID(updateId).name}\n initialDefaultPriority={appStore.getByID(updateId).defaultPriority}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => appStore.remove(deleteId)}\n />\n )}\n \n );\n }\n\n private uploadImage = (id: number) => {\n this.uploadId = id;\n if (this.upload) {\n this.upload.click();\n }\n };\n\n private onUploadImage = (e: ChangeEvent) => {\n const file = e.target.files?.[0];\n if (!file) {\n return;\n }\n if (['image/png', 'image/jpeg', 'image/gif'].indexOf(file.type) !== -1) {\n this.props.appStore.uploadImage(this.uploadId, file);\n } else {\n alert('Uploaded file must be of type png, jpeg or gif.');\n }\n };\n}\n\ninterface IRowProps {\n name: string;\n value: string;\n noDelete: boolean;\n description: string;\n defaultPriority: number;\n lastUsed: string | null;\n fUpload: VoidFunction;\n image: string;\n fDelete: VoidFunction;\n fEdit: VoidFunction;\n}\n\nconst Row: SFC = observer(\n ({\n name,\n value,\n noDelete,\n description,\n defaultPriority,\n lastUsed,\n fDelete,\n fUpload,\n image,\n fEdit,\n }) => (\n \n \n
\n \"app\n \n \n \n
\n
\n {name}\n \n \n \n {description}\n {defaultPriority}\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n )\n);\n\nexport default inject('appStore')(Applications);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string) => void;\n}\n\nexport default class AddDialog extends Component {\n public state = {name: ''};\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name);\n fClose();\n };\n return (\n \n Create a client\n \n \n \n \n \n \n
\n \n Create\n \n
\n \n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string) => void;\n initialName: string;\n}\n\ninterface IState {\n name: string;\n}\n\nexport default class UpdateDialog extends Component {\n public state = {name: ''};\n\n constructor(props: IProps) {\n super(props);\n this.state = {\n name: props.initialName,\n };\n }\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name);\n fClose();\n };\n return (\n \n Update a Client\n \n \n A client manages messages, clients, applications and users (with admin\n permissions).\n \n \n \n \n \n \n
\n \n Update\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = {};\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport React, {Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport AddClientDialog from './AddClientDialog';\nimport UpdateDialog from './UpdateClientDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {IClient} from '../types';\nimport CopyableSecret from '../common/CopyableSecret';\nimport {LastUsedCell} from '../common/LastUsedCell';\n\n@observer\nclass Clients extends Component> {\n @observable\n private showDialog = false;\n @observable\n private deleteId: false | number = false;\n @observable\n private updateId: false | number = false;\n\n public componentDidMount = () => this.props.clientStore.refresh();\n\n public render() {\n const {\n deleteId,\n updateId,\n showDialog,\n props: {clientStore},\n } = this;\n const clients = clientStore.getItems();\n\n return (\n (this.showDialog = true)}>\n Create Client\n \n }>\n \n \n \n \n \n Name\n Token\n Last Used\n \n \n \n \n \n {clients.map((client: IClient) => (\n (this.updateId = client.id)}\n fDelete={() => (this.deleteId = client.id)}\n />\n ))}\n \n
\n
\n
\n {showDialog && (\n (this.showDialog = false)}\n fOnSubmit={clientStore.create}\n />\n )}\n {updateId !== false && (\n (this.updateId = false)}\n fOnSubmit={(name) => clientStore.update(updateId, name)}\n initialName={clientStore.getByID(updateId).name}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => clientStore.remove(deleteId)}\n />\n )}\n \n );\n }\n}\n\ninterface IRowProps {\n name: string;\n value: string;\n lastUsed: string | null;\n fEdit: VoidFunction;\n fDelete: VoidFunction;\n}\n\nconst Row: SFC = ({name, value, lastUsed, fEdit, fDelete}) => (\n \n {name}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default inject('clientStore')(Clients);\n","import React, {Component, SFC} from 'react';\nimport {Link} from 'react-router-dom';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Settings from '@material-ui/icons/Settings';\nimport {Switch, Button} from '@material-ui/core';\nimport DefaultPage from '../common/DefaultPage';\nimport CopyableSecret from '../common/CopyableSecret';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {IPlugin} from '../types';\n\n@observer\nclass Plugins extends Component> {\n public componentDidMount = () => this.props.pluginStore.refresh();\n\n public render() {\n const {\n props: {pluginStore},\n } = this;\n const plugins = pluginStore.getItems();\n return (\n \n \n \n \n \n \n ID\n Enabled\n Name\n Token\n Details\n \n \n \n {plugins.map((plugin: IPlugin) => (\n \n this.props.pluginStore.changeEnabledState(\n plugin.id,\n !plugin.enabled\n )\n }\n />\n ))}\n \n
\n
\n
\n
\n );\n }\n}\n\ninterface IRowProps {\n id: number;\n name: string;\n token: string;\n enabled: boolean;\n fToggleStatus: VoidFunction;\n}\n\nconst Row: SFC = observer(({name, id, token, enabled, fToggleStatus}) => (\n \n {id}\n \n \n \n {name}\n \n \n \n \n \n \n \n \n \n));\n\nexport default inject('pluginStore')(Plugins);\n","import React from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport gfm from 'remark-gfm';\n\nexport const Markdown = ({children}: {children: string}) => (\n {children}\n);\n","import Paper from '@material-ui/core/Paper';\nimport {withStyles, WithStyles} from '@material-ui/core/styles';\nimport * as React from 'react';\n\nconst styles = () => ({\n paper: {\n padding: 16,\n },\n});\n\ninterface IProps extends WithStyles<'paper'> {\n style?: React.CSSProperties;\n}\n\nconst Container: React.FC = ({classes, children, style}) => (\n \n {children}\n \n);\n\nexport default withStyles(styles)(Container);\n","import React, {Component} from 'react';\nimport {RouteComponentProps} from 'react-router';\nimport {Markdown} from '../common/Markdown';\nimport {UnControlled as CodeMirror} from 'react-codemirror2';\nimport 'codemirror/lib/codemirror.css';\nimport 'codemirror/theme/material.css';\nimport 'codemirror/mode/yaml/yaml';\nimport Info from '@material-ui/icons/Info';\nimport Build from '@material-ui/icons/Build';\nimport Subject from '@material-ui/icons/Subject';\nimport Refresh from '@material-ui/icons/Refresh';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport DefaultPage from '../common/DefaultPage';\nimport * as config from '../config';\nimport Container from '../common/Container';\nimport {inject, Stores} from '../inject';\nimport {IPlugin} from '../types';\n\ntype IProps = RouteComponentProps<{id: string}>;\n\ninterface IState {\n displayText: string | null;\n currentConfig: string | null;\n}\n\nclass PluginDetailView extends Component, IState> {\n private pluginID: number = parseInt(this.props.match.params.id, 10);\n private pluginInfo = () => this.props.pluginStore.getByID(this.pluginID);\n\n public state: IState = {\n displayText: null,\n currentConfig: null,\n };\n\n public componentWillMount() {\n this.refreshFeatures();\n }\n\n public componentWillReceiveProps(nextProps: IProps & Stores<'pluginStore'>) {\n this.pluginID = parseInt(nextProps.match.params.id, 10);\n this.refreshFeatures();\n }\n\n private refreshFeatures() {\n return Promise.all([this.refreshConfigurer(), this.refreshDisplayer()]);\n }\n\n private async refreshConfigurer() {\n const {\n props: {pluginStore},\n } = this;\n if (this.pluginInfo().capabilities.indexOf('configurer') !== -1) {\n const response = await pluginStore.requestConfig(this.pluginID);\n this.setState({currentConfig: response});\n }\n }\n\n private async refreshDisplayer() {\n const {\n props: {pluginStore},\n } = this;\n if (this.pluginInfo().capabilities.indexOf('displayer') !== -1) {\n const response = await pluginStore.requestDisplay(this.pluginID);\n this.setState({displayText: response});\n }\n }\n\n public render() {\n const pluginInfo = this.pluginInfo();\n const {name, capabilities} = pluginInfo;\n return (\n \n \n \n \n {capabilities.indexOf('configurer') !== -1 ? (\n \n {\n await this.props.pluginStore.changeConfig(this.pluginID, newConfig);\n await this.refreshFeatures();\n }}\n />\n \n ) : null}{' '}\n {capabilities.indexOf('displayer') !== -1 ? (\n \n \n \n ) : null}\n \n );\n }\n}\n\ninterface IPanelWrapperProps {\n name: string;\n description?: string;\n refresh?: () => Promise;\n icon?: React.ComponentType;\n}\n\nconst PanelWrapper: React.FC = ({\n name,\n description,\n refresh,\n icon,\n children,\n}) => {\n const Icon = icon;\n return (\n \n \n {Icon ? (\n \n \n  \n \n ) : null}\n {name}\n {refresh ? (\n {\n refresh();\n }}>\n \n \n ) : null}\n \n {description ? {description} : null}\n
\n
{children}
\n
\n );\n};\n\ninterface IConfigurerPanelProps {\n pluginInfo: IPlugin;\n initialConfig: string;\n save: (newConfig: string) => Promise;\n}\nclass ConfigurerPanel extends Component {\n public state = {unsavedChanges: null};\n\n public render() {\n return (\n
\n {\n let newConf: string | null = value;\n if (value === this.props.initialConfig) {\n newConf = null;\n }\n this.setState({unsavedChanges: newConf});\n }}\n />\n
\n {\n const newConfig = this.state.unsavedChanges;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.props.save(newConfig!).then(() => {\n this.setState({unsavedChanges: null});\n });\n }}>\n Save\n \n
\n );\n }\n}\n\ninterface IDisplayerPanelProps {\n pluginInfo: IPlugin;\n displayText: string;\n}\nconst DisplayerPanel: React.FC = ({displayText}) => (\n \n {displayText}\n \n);\n\nclass PluginInfo extends Component<{pluginInfo: IPlugin}> {\n public render() {\n const {\n props: {\n pluginInfo: {name, author, modulePath, website, license, capabilities, id, token},\n },\n } = this;\n return (\n
\n {name ? (\n \n Name: {name}\n \n ) : null}\n {author ? (\n \n Author: {author}\n \n ) : null}\n \n Module Path: {modulePath}\n \n {website ? (\n \n Website: {website}\n \n ) : null}\n {license ? (\n \n License: {license}\n \n ) : null}\n \n Capabilities: {capabilities.join(', ')}\n \n {capabilities.indexOf('webhooker') !== -1 ? (\n \n Custom Route Prefix:{' '}\n {((url) => (\n \n {url}\n \n ))(`${config.get('url')}plugin/${id}/custom/${token}/`)}\n \n ) : null}\n
\n );\n }\n}\n\nexport default inject('pluginStore')(PluginDetailView);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {ChangeEvent, Component} from 'react';\n\ninterface IProps {\n name?: string;\n fClose: VoidFunction;\n fOnSubmit: (name: string, pass: string) => Promise;\n}\n\ninterface IState {\n name: string;\n pass: string;\n}\n\nexport default class RegistrationDialog extends Component {\n public state = {\n name: '',\n pass: '',\n };\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name, pass} = this.state;\n const namePresent = this.state.name.length !== 0;\n const passPresent = this.state.pass.length !== 0;\n const submitAndClose = (): void => {\n fOnSubmit(name, pass).then((success) => {\n if (success) {\n fClose();\n }\n });\n };\n return (\n \n Registration\n \n \n \n \n \n \n \n
\n \n Register\n \n
\n \n
\n \n );\n }\n\n private handleChange(propertyName: string, event: ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport React, {Component, FormEvent} from 'react';\nimport Container from '../common/Container';\nimport DefaultPage from '../common/DefaultPage';\nimport {observable} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport * as config from '../config';\nimport RegistrationDialog from './Register';\n\n@observer\nclass Login extends Component> {\n @observable\n private username = '';\n @observable\n private password = '';\n @observable\n private registerDialog = false;\n\n public render() {\n const {username, password, registerDialog} = this;\n return (\n \n \n \n
\n (this.username = e.target.value)}\n />\n (this.password = e.target.value)}\n />\n \n Login\n \n \n
\n
\n {registerDialog && (\n (this.registerDialog = false)}\n fOnSubmit={this.props.currentUser.register}\n />\n )}\n
\n );\n }\n\n private login = (e: React.MouseEvent) => {\n e.preventDefault();\n this.props.currentUser.login(this.username, this.password);\n };\n\n private registerButton = () => {\n if (config.get('register'))\n return (\n (this.registerDialog = true)}>\n Register\n \n );\n else return null;\n };\n\n private preventDefault = (e: FormEvent) => e.preventDefault();\n}\n\nexport default inject('currentUser')(Login);\n","import IconButton from '@material-ui/core/IconButton';\nimport {createStyles, Theme, withStyles, WithStyles} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Delete from '@material-ui/icons/Delete';\nimport React from 'react';\nimport TimeAgo from 'react-timeago';\nimport Container from '../common/Container';\nimport * as config from '../config';\nimport {Markdown} from '../common/Markdown';\nimport {RenderMode, contentType} from './extras';\nimport {IMessageExtras} from '../types';\n\nconst styles = (theme: Theme) =>\n createStyles({\n header: {\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: 0,\n },\n headerTitle: {\n flex: 1,\n },\n trash: {\n marginTop: -15,\n marginRight: -15,\n },\n wrapperPadding: {\n padding: 12,\n },\n messageContentWrapper: {\n width: '100%',\n maxWidth: 585,\n },\n image: {\n marginRight: 15,\n [theme.breakpoints.down('sm')]: {\n width: 32,\n height: 32,\n },\n },\n date: {\n [theme.breakpoints.down('sm')]: {\n order: 1,\n flexBasis: '100%',\n opacity: 0.7,\n },\n },\n imageWrapper: {\n display: 'flex',\n },\n plainContent: {\n whiteSpace: 'pre-wrap',\n },\n content: {\n wordBreak: 'break-all',\n '& p': {\n margin: 0,\n },\n '& a': {\n color: '#ff7f50',\n },\n '& pre': {\n overflow: 'auto',\n },\n '& img': {\n maxWidth: '100%',\n },\n },\n });\n\ninterface IProps {\n title: string;\n image?: string;\n date: string;\n content: string;\n priority: number;\n fDelete: VoidFunction;\n extras?: IMessageExtras;\n height: (height: number) => void;\n}\n\nconst priorityColor = (priority: number) => {\n if (priority >= 4 && priority <= 7) {\n return 'rgba(230, 126, 34, 0.7)';\n } else if (priority > 7) {\n return '#e74c3c';\n } else {\n return 'transparent';\n }\n};\n\nclass Message extends React.PureComponent> {\n private node: HTMLDivElement | null = null;\n\n public componentDidMount = () =>\n this.props.height(this.node ? this.node.getBoundingClientRect().height : 0);\n\n private renderContent = () => {\n const content = this.props.content;\n switch (contentType(this.props.extras)) {\n case RenderMode.Markdown:\n return {content};\n case RenderMode.Plain:\n default:\n return {content};\n }\n };\n\n public render(): React.ReactNode {\n const {fDelete, classes, title, date, image, priority} = this.props;\n\n return (\n
(this.node = ref)}>\n \n
\n {image !== null ? (\n \n ) : null}\n
\n
\n
\n \n {title}\n \n \n \n \n \n \n \n
\n \n {this.renderContent()}\n \n
\n \n
\n );\n }\n}\n\nexport default withStyles(styles, {withTheme: true})(Message);\n","import CircularProgress from '@material-ui/core/CircularProgress';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, {Component} from 'react';\nimport {RouteComponentProps} from 'react-router';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport Message from './Message';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {observable} from 'mobx';\nimport ReactInfinite from 'react-infinite';\nimport {IMessage} from '../types';\nimport ConfirmDialog from '../common/ConfirmDialog';\n\ntype IProps = RouteComponentProps<{id: string}>;\n\ninterface IState {\n appId: number;\n}\n\n@observer\nclass Messages extends Component, IState> {\n @observable\n private heights: Record = {};\n @observable\n private deleteAll = false;\n\n private static appId(props: IProps) {\n if (props === undefined) {\n return -1;\n }\n const {match} = props;\n return match.params.id !== undefined ? parseInt(match.params.id, 10) : -1;\n }\n\n public state = {appId: -1};\n\n private isLoadingMore = false;\n\n public componentWillReceiveProps(nextProps: IProps & Stores<'messagesStore' | 'appStore'>) {\n this.updateAllWithProps(nextProps);\n }\n\n public componentWillMount() {\n window.onscroll = () => {\n if (\n window.innerHeight + window.pageYOffset >=\n document.body.offsetHeight - window.innerHeight * 2\n ) {\n this.checkIfLoadMore();\n }\n };\n this.updateAll();\n }\n\n public render() {\n const {appId} = this.state;\n const {messagesStore, appStore} = this.props;\n const messages = messagesStore.get(appId);\n const hasMore = messagesStore.canLoadMore(appId);\n const name = appStore.getName(appId);\n const hasMessages = messages.length !== 0;\n\n return (\n \n messagesStore.refreshByApp(appId)}\n style={{marginRight: 5}}>\n Refresh\n \n {\n this.deleteAll = true;\n }}>\n Delete All\n \n
\n }>\n {hasMessages ? (\n
\n this.heights[m.id] || 1)}>\n {messages.map(this.renderMessage)}\n \n\n {hasMore ? (\n \n \n \n ) : (\n this.label(\"You've reached the end\")\n )}\n
\n ) : (\n this.label('No messages')\n )}\n\n {this.deleteAll && (\n (this.deleteAll = false)}\n fOnSubmit={() => messagesStore.removeByApp(appId)}\n />\n )}\n \n );\n }\n\n private updateAllWithProps = (props: IProps & Stores<'messagesStore'>) => {\n const appId = Messages.appId(props);\n this.setState({appId});\n if (!props.messagesStore.exists(appId)) {\n props.messagesStore.loadMore(appId);\n }\n };\n\n private updateAll = () => this.updateAllWithProps(this.props);\n\n private deleteMessage = (message: IMessage) => () =>\n this.props.messagesStore.removeSingle(message);\n\n private renderMessage = (message: IMessage) => (\n {\n if (!this.heights[message.id]) {\n this.heights[message.id] = height;\n }\n }}\n fDelete={this.deleteMessage(message)}\n title={message.title}\n date={message.date}\n content={message.message}\n image={message.image}\n extras={message.extras}\n priority={message.priority}\n />\n );\n\n private checkIfLoadMore() {\n const {appId} = this.state;\n if (!this.isLoadingMore && this.props.messagesStore.canLoadMore(appId)) {\n this.isLoadingMore = true;\n this.props.messagesStore.loadMore(appId).then(() => (this.isLoadingMore = false));\n }\n }\n\n private label = (text: string) => (\n \n \n {text}\n \n \n );\n}\n\nexport default inject('messagesStore', 'appStore')(Messages);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {ChangeEvent, Component} from 'react';\n\ninterface IProps {\n name?: string;\n admin?: boolean;\n fClose: VoidFunction;\n fOnSubmit: (name: string, pass: string, admin: boolean) => void;\n isEdit?: boolean;\n}\n\ninterface IState {\n name: string;\n pass: string;\n admin: boolean;\n}\n\nexport default class AddEditDialog extends Component {\n public state = {\n name: this.props.name ?? '',\n pass: '',\n admin: this.props.admin ?? false,\n };\n\n public render() {\n const {fClose, fOnSubmit, isEdit} = this.props;\n const {name, pass, admin} = this.state;\n const namePresent = this.state.name.length !== 0;\n const passPresent = this.state.pass.length !== 0 || isEdit;\n const submitAndClose = () => {\n fOnSubmit(name, pass, admin);\n fClose();\n };\n return (\n \n \n {isEdit ? 'Edit ' + this.props.name : 'Add a user'}\n \n \n \n \n \n }\n label=\"has administrator rights\"\n />\n \n \n \n \n
\n \n {isEdit ? 'Save' : 'Create'}\n \n
\n \n
\n \n );\n }\n\n private handleChange(propertyName: string, event: ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n\n private handleChecked(propertyName: string, event: ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.checked;\n this.setState(state);\n }\n}\n","import Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport {withStyles, WithStyles} from '@material-ui/core/styles';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport React, {Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport AddEditDialog from './AddEditUserDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {IUser} from '../types';\n\nconst styles = () => ({\n wrapper: {\n margin: '0 auto',\n maxWidth: 700,\n },\n});\n\ninterface IRowProps {\n name: string;\n admin: boolean;\n fDelete: VoidFunction;\n fEdit: VoidFunction;\n}\n\nconst UserRow: SFC = ({name, admin, fDelete, fEdit}) => (\n \n {name}\n {admin ? 'Yes' : 'No'}\n \n \n \n \n \n \n \n \n \n);\n\n@observer\nclass Users extends Component & Stores<'userStore'>> {\n @observable\n private createDialog = false;\n @observable\n private deleteId: number | false = false;\n @observable\n private editId: number | false = false;\n\n public componentDidMount = () => this.props.userStore.refresh();\n\n public render() {\n const {\n deleteId,\n editId,\n createDialog,\n props: {userStore},\n } = this;\n const users = userStore.getItems();\n return (\n (this.createDialog = true)}>\n Create User\n \n }>\n \n \n \n \n \n Name\n Admin\n \n \n \n \n {users.map((user: IUser) => (\n (this.deleteId = user.id)}\n fEdit={() => (this.editId = user.id)}\n />\n ))}\n \n
\n
\n
\n {createDialog && (\n (this.createDialog = false)}\n fOnSubmit={userStore.create}\n />\n )}\n {editId !== false && (\n (this.editId = false)}\n fOnSubmit={userStore.update.bind(this, editId)}\n name={userStore.getByID(editId).name}\n admin={userStore.getByID(editId).admin}\n isEdit={true}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => userStore.remove(deleteId)}\n />\n )}\n \n );\n }\n}\n\nexport default withStyles(styles)(inject('userStore')(Users));\n","import React from 'react';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\n\ninterface ConnectionErrorBannerProps {\n height: number;\n retry: () => void;\n message: string;\n}\n\nexport const ConnectionErrorBanner = ({height, retry, message}: ConnectionErrorBannerProps) => (\n \n \n {message}{' '}\n \n \n \n);\n","import {createMuiTheme, MuiThemeProvider, Theme, WithStyles, withStyles} from '@material-ui/core';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport * as React from 'react';\nimport {HashRouter, Redirect, Route, Switch} from 'react-router-dom';\nimport Header from './Header';\nimport LoadingSpinner from '../common/LoadingSpinner';\nimport Navigation from './Navigation';\nimport ScrollUpButton from '../common/ScrollUpButton';\nimport SettingsDialog from '../common/SettingsDialog';\nimport SnackBarHandler from '../snack/SnackBarHandler';\nimport * as config from '../config';\nimport Applications from '../application/Applications';\nimport Clients from '../client/Clients';\nimport Plugins from '../plugin/Plugins';\nimport PluginDetailView from '../plugin/PluginDetailView';\nimport Login from '../user/Login';\nimport Messages from '../message/Messages';\nimport Users from '../user/Users';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {ConnectionErrorBanner} from '../common/ConnectionErrorBanner';\n\nconst styles = (theme: Theme) => ({\n content: {\n margin: '0 auto',\n marginTop: 64,\n padding: theme.spacing(4),\n width: '100%',\n [theme.breakpoints.down('xs')]: {\n marginTop: 0,\n },\n },\n});\n\nconst localStorageThemeKey = 'gotify-theme';\ntype ThemeKey = 'dark' | 'light';\nconst themeMap: Record = {\n light: createMuiTheme({\n palette: {\n type: 'light',\n },\n }),\n dark: createMuiTheme({\n palette: {\n type: 'dark',\n },\n }),\n};\n\nconst isThemeKey = (value: string | null): value is ThemeKey =>\n value === 'light' || value === 'dark';\n\n@observer\nclass Layout extends React.Component<\n WithStyles<'content'> & Stores<'currentUser' | 'snackManager'>\n> {\n @observable\n private currentTheme: ThemeKey = 'dark';\n @observable\n private showSettings = false;\n @observable\n private navOpen = false;\n\n private setNavOpen(open: boolean) {\n this.navOpen = open;\n }\n\n public componentDidMount() {\n const localStorageTheme = window.localStorage.getItem(localStorageThemeKey);\n if (isThemeKey(localStorageTheme)) {\n this.currentTheme = localStorageTheme;\n } else {\n window.localStorage.setItem(localStorageThemeKey, this.currentTheme);\n }\n }\n\n public render() {\n const {showSettings, currentTheme} = this;\n const {\n classes,\n currentUser: {\n loggedIn,\n authenticating,\n user: {name, admin},\n logout,\n tryReconnect,\n connectionErrorMessage,\n },\n } = this.props;\n const theme = themeMap[currentTheme];\n const loginRoute = () => (loggedIn ? : );\n const {version} = config.get('version');\n return (\n \n \n
\n {!connectionErrorMessage ? null : (\n tryReconnect()}\n message={connectionErrorMessage}\n />\n )}\n
\n \n (this.showSettings = true)}\n logout={logout}\n setNavOpen={this.setNavOpen.bind(this)}\n />\n
\n \n
\n \n {authenticating ? (\n \n \n \n ) : null}\n \n {loggedIn ? null : }\n \n \n \n \n \n \n \n \n
\n
\n {showSettings && (\n (this.showSettings = false)} />\n )}\n \n \n
\n
\n
\n
\n );\n }\n\n private toggleTheme() {\n this.currentTheme = this.currentTheme === 'dark' ? 'light' : 'dark';\n localStorage.setItem(localStorageThemeKey, this.currentTheme);\n }\n}\n\nexport default withStyles(styles, {withTheme: true})(inject('currentUser', 'snackManager')(Layout));\n","import axios, {AxiosError, AxiosResponse} from 'axios';\nimport * as config from './config';\nimport {Base64} from 'js-base64';\nimport {detect} from 'detect-browser';\nimport {SnackReporter} from './snack/SnackManager';\nimport {observable} from 'mobx';\nimport {IClient, IUser} from './types';\n\nconst tokenKey = 'gotify-login-key';\n\nexport class CurrentUser {\n private tokenCache: string | null = null;\n private reconnectTimeoutId: number | null = null;\n private reconnectTime = 7500;\n @observable\n public loggedIn = false;\n @observable\n public authenticating = false;\n @observable\n public user: IUser = {name: 'unknown', admin: false, id: -1};\n @observable\n public connectionErrorMessage: string | null = null;\n\n public constructor(private readonly snack: SnackReporter) {}\n\n public token = (): string => {\n if (this.tokenCache !== null) {\n return this.tokenCache;\n }\n\n const localStorageToken = window.localStorage.getItem(tokenKey);\n if (localStorageToken) {\n this.tokenCache = localStorageToken;\n return localStorageToken;\n }\n\n return '';\n };\n\n private readonly setToken = (token: string) => {\n this.tokenCache = token;\n window.localStorage.setItem(tokenKey, token);\n };\n\n public register = async (name: string, pass: string): Promise =>\n axios\n .create()\n .post(config.get('url') + 'user', {name, pass})\n .then(() => {\n this.snack('User Created. Logging in...');\n this.login(name, pass);\n return true;\n })\n .catch((error: AxiosError) => {\n if (!error || !error.response) {\n this.snack('No network connection or server unavailable.');\n return false;\n }\n const {data} = error.response;\n this.snack(\n `Register failed: ${data?.error ?? 'unknown'}: ${data?.errorDescription ?? ''}`\n );\n return false;\n });\n\n public login = async (username: string, password: string) => {\n this.loggedIn = false;\n this.authenticating = true;\n const browser = detect();\n const name = (browser && browser.name + ' ' + browser.version) || 'unknown browser';\n axios\n .create()\n .request({\n url: config.get('url') + 'client',\n method: 'POST',\n data: {name},\n // eslint-disable-next-line @typescript-eslint/naming-convention\n headers: {Authorization: 'Basic ' + Base64.encode(username + ':' + password)},\n })\n .then((resp: AxiosResponse) => {\n this.snack(`A client named '${name}' was created for your session.`);\n this.setToken(resp.data.token);\n this.tryAuthenticate()\n .then(() => {\n this.authenticating = false;\n this.loggedIn = true;\n })\n .catch(() => {\n this.authenticating = false;\n console.log(\n 'create client succeeded, but authenticated with given token failed'\n );\n });\n })\n .catch(() => {\n this.authenticating = false;\n return this.snack('Login failed');\n });\n };\n\n public tryAuthenticate = async (): Promise> => {\n if (this.token() === '') {\n return Promise.reject();\n }\n\n return (\n axios\n .create()\n // eslint-disable-next-line @typescript-eslint/naming-convention\n .get(config.get('url') + 'current/user', {headers: {'X-Gotify-Key': this.token()}})\n .then((passThrough) => {\n this.user = passThrough.data;\n this.loggedIn = true;\n this.connectionErrorMessage = null;\n this.reconnectTime = 7500;\n return passThrough;\n })\n .catch((error: AxiosError) => {\n if (!error || !error.response) {\n this.connectionError('No network connection or server unavailable.');\n return Promise.reject(error);\n }\n\n if (error.response.status >= 500) {\n this.connectionError(\n `${error.response.statusText} (code: ${error.response.status}).`\n );\n return Promise.reject(error);\n }\n\n this.connectionErrorMessage = null;\n\n if (error.response.status >= 400 && error.response.status < 500) {\n this.logout();\n }\n return Promise.reject(error);\n })\n );\n };\n\n public logout = async () => {\n await axios\n .get(config.get('url') + 'client')\n .then((resp: AxiosResponse) => {\n resp.data\n .filter((client) => client.token === this.tokenCache)\n .forEach((client) => axios.delete(config.get('url') + 'client/' + client.id));\n })\n .catch(() => Promise.resolve());\n window.localStorage.removeItem(tokenKey);\n this.tokenCache = null;\n this.loggedIn = false;\n };\n\n public changePassword = (pass: string) => {\n axios\n .post(config.get('url') + 'current/user/password', {pass})\n .then(() => this.snack('Password changed'));\n };\n\n public tryReconnect = (quiet = false) => {\n this.tryAuthenticate().catch(() => {\n if (!quiet) {\n this.snack('Reconnect failed');\n }\n });\n };\n\n private readonly connectionError = (message: string) => {\n this.connectionErrorMessage = message;\n if (this.reconnectTimeoutId !== null) {\n window.clearTimeout(this.reconnectTimeoutId);\n }\n this.reconnectTimeoutId = window.setTimeout(\n () => this.tryReconnect(true),\n this.reconnectTime\n );\n this.reconnectTime = Math.min(this.reconnectTime * 2, 120000);\n };\n}\n","import {action, observable} from 'mobx';\n\ninterface HasID {\n id: number;\n}\n\nexport interface IClearable {\n clear(): void;\n}\n\n/**\n * Base implementation for handling items with ids.\n */\nexport abstract class BaseStore implements IClearable {\n @observable\n protected items: T[] = [];\n\n protected abstract requestItems(): Promise;\n\n protected abstract requestDelete(id: number): Promise;\n\n @action\n public remove = async (id: number): Promise => {\n await this.requestDelete(id);\n await this.refresh();\n };\n\n @action\n public refresh = async (): Promise => {\n this.items = await this.requestItems().then((items) => items || []);\n };\n\n public getByID = (id: number): T => {\n const item = this.getByIDOrUndefined(id);\n if (item === undefined) {\n throw new Error('cannot find item with id ' + id);\n }\n return item;\n };\n\n public getByIDOrUndefined = (id: number): T | undefined =>\n this.items.find((hasId: HasID) => hasId.id === id);\n\n public getItems = (): T[] => this.items;\n\n @action\n public clear = (): void => {\n this.items = [];\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IApplication} from '../types';\n\nexport class AppStore extends BaseStore {\n public onDelete: () => void = () => {};\n\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise =>\n axios\n .get(`${config.get('url')}application`)\n .then((response) => response.data);\n\n protected requestDelete = (id: number): Promise =>\n axios.delete(`${config.get('url')}application/${id}`).then(() => {\n this.onDelete();\n return this.snack('Application deleted');\n });\n\n @action\n public uploadImage = async (id: number, file: Blob): Promise => {\n const formData = new FormData();\n formData.append('file', file);\n await axios.post(`${config.get('url')}application/${id}/image`, formData, {\n headers: {'content-type': 'multipart/form-data'},\n });\n await this.refresh();\n this.snack('Application image updated');\n };\n\n @action\n public update = async (\n id: number,\n name: string,\n description: string,\n defaultPriority: number\n ): Promise => {\n await axios.put(`${config.get('url')}application/${id}`, {\n name,\n description,\n defaultPriority,\n });\n await this.refresh();\n this.snack('Application updated');\n };\n\n @action\n public create = async (\n name: string,\n description: string,\n defaultPriority: number\n ): Promise => {\n await axios.post(`${config.get('url')}application`, {\n name,\n description,\n defaultPriority,\n });\n await this.refresh();\n this.snack('Application created');\n };\n\n public getName = (id: number): string => {\n const app = this.getByIDOrUndefined(id);\n return id === -1 ? 'All Messages' : app !== undefined ? app.name : 'unknown';\n };\n}\n","import {SnackReporter} from '../snack/SnackManager';\nimport {CurrentUser} from '../CurrentUser';\nimport * as config from '../config';\nimport {AxiosError} from 'axios';\nimport {IMessage} from '../types';\n\nexport class WebSocketStore {\n private wsActive = false;\n private ws: WebSocket | null = null;\n\n public constructor(\n private readonly snack: SnackReporter,\n private readonly currentUser: CurrentUser\n ) {}\n\n public listen = (callback: (msg: IMessage) => void) => {\n if (!this.currentUser.token() || this.wsActive) {\n return;\n }\n this.wsActive = true;\n\n const wsUrl = config.get('url').replace('http', 'ws').replace('https', 'wss');\n const ws = new WebSocket(wsUrl + 'stream?token=' + this.currentUser.token());\n\n ws.onerror = (e) => {\n this.wsActive = false;\n console.log('WebSocket connection errored', e);\n };\n\n ws.onmessage = (data) => callback(JSON.parse(data.data));\n\n ws.onclose = () => {\n this.wsActive = false;\n this.currentUser\n .tryAuthenticate()\n .then(() => {\n this.snack('WebSocket connection closed, trying again in 30 seconds.');\n setTimeout(() => this.listen(callback), 30000);\n })\n .catch((error: AxiosError) => {\n if (error?.response?.status === 401) {\n this.snack('Could not authenticate with client token, logging out.');\n }\n });\n };\n\n this.ws = ws;\n };\n\n public close = () => this.ws?.close(1000, 'WebSocketStore#close');\n}\n","import {action, observable} from 'mobx';\n\nexport interface SnackReporter {\n (message: string): void;\n}\n\nexport class SnackManager {\n @observable\n private messages: string[] = [];\n @observable\n public message: string | null = null;\n @observable\n public counter = 0;\n\n @action\n public next = (): void => {\n if (!this.hasNext()) {\n throw new Error('There is nothing here :(');\n }\n this.message = this.messages.shift() as string;\n };\n\n public hasNext = () => this.messages.length > 0;\n\n @action\n public snack: SnackReporter = (message: string): void => {\n this.messages.push(message);\n this.counter++;\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IUser} from '../types';\n\nexport class UserStore extends BaseStore {\n constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise =>\n axios.get(`${config.get('url')}user`).then((response) => response.data);\n\n protected requestDelete(id: number): Promise {\n return axios\n .delete(`${config.get('url')}user/${id}`)\n .then(() => this.snack('User deleted'));\n }\n\n @action\n public create = async (name: string, pass: string, admin: boolean) => {\n await axios.post(`${config.get('url')}user`, {name, pass, admin});\n await this.refresh();\n this.snack('User created');\n };\n\n @action\n public update = async (id: number, name: string, pass: string | null, admin: boolean) => {\n await axios.post(config.get('url') + 'user/' + id, {name, pass, admin});\n await this.refresh();\n this.snack('User updated');\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport {action, IObservableArray, observable, reaction} from 'mobx';\nimport axios, {AxiosResponse} from 'axios';\nimport * as config from '../config';\nimport {createTransformer} from 'mobx-utils';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IApplication, IMessage, IPagedMessages} from '../types';\n\nconst AllMessages = -1;\n\ninterface MessagesState {\n messages: IObservableArray;\n hasMore: boolean;\n nextSince: number;\n loaded: boolean;\n}\n\nexport class MessagesStore {\n @observable\n private state: Record = {};\n\n private loading = false;\n\n public constructor(\n private readonly appStore: BaseStore,\n private readonly snack: SnackReporter\n ) {\n reaction(() => appStore.getItems(), this.createEmptyStatesForApps);\n }\n\n private stateOf = (appId: number, create = true) => {\n if (!this.state[appId] && create) {\n this.state[appId] = this.emptyState();\n }\n return this.state[appId] || this.emptyState();\n };\n\n public canLoadMore = (appId: number) => this.stateOf(appId, /*create*/ false).hasMore;\n\n @action\n public loadMore = async (appId: number) => {\n const state = this.stateOf(appId);\n if (!state.hasMore || this.loading) {\n return Promise.resolve();\n }\n this.loading = true;\n\n const pagedResult = await this.fetchMessages(appId, state.nextSince).then(\n (resp) => resp.data\n );\n\n state.messages.replace([...state.messages, ...pagedResult.messages]);\n state.nextSince = pagedResult.paging.since ?? 0;\n state.hasMore = 'next' in pagedResult.paging;\n state.loaded = true;\n this.loading = false;\n return Promise.resolve();\n };\n\n @action\n public publishSingleMessage = (message: IMessage) => {\n if (this.exists(AllMessages)) {\n this.stateOf(AllMessages).messages.unshift(message);\n }\n if (this.exists(message.appid)) {\n this.stateOf(message.appid).messages.unshift(message);\n }\n };\n\n @action\n public removeByApp = async (appId: number) => {\n if (appId === AllMessages) {\n await axios.delete(config.get('url') + 'message');\n this.snack('Deleted all messages');\n this.clearAll();\n } else {\n await axios.delete(config.get('url') + 'application/' + appId + '/message');\n this.snack(`Deleted all messages from ${this.appStore.getByID(appId).name}`);\n this.clear(AllMessages);\n this.clear(appId);\n }\n await this.loadMore(appId);\n };\n\n @action\n public removeSingle = async (message: IMessage) => {\n await axios.delete(config.get('url') + 'message/' + message.id);\n if (this.exists(AllMessages)) {\n this.removeFromList(this.state[AllMessages].messages, message);\n }\n if (this.exists(message.appid)) {\n this.removeFromList(this.state[message.appid].messages, message);\n }\n this.snack('Message deleted');\n };\n\n @action\n public clearAll = () => {\n this.state = {};\n this.createEmptyStatesForApps(this.appStore.getItems());\n };\n\n @action\n public refreshByApp = async (appId: number) => {\n this.clearAll();\n this.loadMore(appId);\n };\n\n public exists = (id: number) => this.stateOf(id).loaded;\n\n private removeFromList(messages: IMessage[], messageToDelete: IMessage): false | number {\n if (messages) {\n const index = messages.findIndex((message) => message.id === messageToDelete.id);\n if (index !== -1) {\n messages.splice(index, 1);\n return index;\n }\n }\n return false;\n }\n\n private clear = (appId: number) => (this.state[appId] = this.emptyState());\n\n private fetchMessages = (\n appId: number,\n since: number\n ): Promise> => {\n if (appId === AllMessages) {\n return axios.get(config.get('url') + 'message?since=' + since);\n } else {\n return axios.get(\n config.get('url') + 'application/' + appId + '/message?since=' + since\n );\n }\n };\n\n private getUnCached = (appId: number): Array => {\n const appToImage = this.appStore\n .getItems()\n .reduce((all, app) => ({...all, [app.id]: app.image}), {});\n\n return this.stateOf(appId, false).messages.map((message: IMessage) => ({\n ...message,\n image: appToImage[message.appid] || null,\n }));\n };\n\n public get = createTransformer(this.getUnCached);\n\n private clearCache = () => (this.get = createTransformer(this.getUnCached));\n\n private createEmptyStatesForApps = (apps: IApplication[]) => {\n apps.map((app) => app.id).forEach((id) => this.stateOf(id, /*create*/ true));\n this.clearCache();\n };\n\n private emptyState = (): MessagesState => ({\n messages: observable.array(),\n hasMore: true,\n nextSince: 0,\n loaded: false,\n });\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IClient} from '../types';\n\nexport class ClientStore extends BaseStore {\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise =>\n axios.get(`${config.get('url')}client`).then((response) => response.data);\n\n protected requestDelete(id: number): Promise {\n return axios\n .delete(`${config.get('url')}client/${id}`)\n .then(() => this.snack('Client deleted'));\n }\n\n @action\n public update = async (id: number, name: string): Promise => {\n await axios.put(`${config.get('url')}client/${id}`, {name});\n await this.refresh();\n this.snack('Client updated');\n };\n\n @action\n public createNoNotifcation = async (name: string): Promise => {\n const client = await axios.post(`${config.get('url')}client`, {name});\n await this.refresh();\n return client.data;\n };\n\n @action\n public create = async (name: string): Promise => {\n await this.createNoNotifcation(name);\n this.snack('Client added');\n };\n}\n","import axios from 'axios';\nimport {action} from 'mobx';\nimport {BaseStore} from '../common/BaseStore';\nimport * as config from '../config';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IPlugin} from '../types';\n\nexport class PluginStore extends BaseStore {\n public onDelete: () => void = () => {};\n\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n public requestConfig = (id: number): Promise =>\n axios.get(`${config.get('url')}plugin/${id}/config`).then((response) => response.data);\n\n public requestDisplay = (id: number): Promise =>\n axios.get(`${config.get('url')}plugin/${id}/display`).then((response) => response.data);\n\n protected requestItems = (): Promise =>\n axios.get(`${config.get('url')}plugin`).then((response) => response.data);\n\n protected requestDelete = (): Promise => {\n this.snack('Cannot delete plugin');\n throw new Error('Cannot delete plugin');\n };\n\n public getName = (id: number): string => {\n const plugin = this.getByIDOrUndefined(id);\n return id === -1 ? 'All Plugins' : plugin !== undefined ? plugin.name : 'unknown';\n };\n\n @action\n public changeConfig = async (id: number, newConfig: string): Promise => {\n await axios.post(`${config.get('url')}plugin/${id}/config`, newConfig, {\n headers: {'content-type': 'application/x-yaml'},\n });\n this.snack(`Plugin config updated`);\n await this.refresh();\n };\n\n @action\n public changeEnabledState = async (id: number, enabled: boolean): Promise => {\n await axios.post(`${config.get('url')}plugin/${id}/${enabled ? 'enable' : 'disable'}`);\n this.snack(`Plugin ${enabled ? 'enabled' : 'disabled'}`);\n await this.refresh();\n };\n}\n","import {StoreMapping} from './inject';\nimport {reaction} from 'mobx';\nimport * as Notifications from './snack/browserNotification';\n\nexport const registerReactions = (stores: StoreMapping) => {\n const clearAll = () => {\n stores.messagesStore.clearAll();\n stores.appStore.clear();\n stores.clientStore.clear();\n stores.userStore.clear();\n stores.wsStore.close();\n };\n const loadAll = () => {\n stores.wsStore.listen((message) => {\n stores.messagesStore.publishSingleMessage(message);\n Notifications.notifyNewMessage(message);\n if (message.priority >= 4) {\n const src = 'static/notification.ogg';\n const audio = new Audio(src);\n audio.play();\n }\n });\n stores.appStore.refresh();\n };\n\n reaction(\n () => stores.currentUser.loggedIn,\n (loggedIn) => {\n if (loggedIn) {\n loadAll();\n } else {\n clearAll();\n }\n }\n );\n\n reaction(\n () => stores.currentUser.connectionErrorMessage,\n (connectionErrorMessage) => {\n if (!connectionErrorMessage) {\n clearAll();\n loadAll();\n }\n }\n );\n};\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport 'typeface-roboto';\nimport {initAxios} from './apiAuth';\nimport * as config from './config';\nimport Layout from './layout/Layout';\nimport {unregister} from './registerServiceWorker';\nimport {CurrentUser} from './CurrentUser';\nimport {AppStore} from './application/AppStore';\nimport {WebSocketStore} from './message/WebSocketStore';\nimport {SnackManager} from './snack/SnackManager';\nimport {InjectProvider, StoreMapping} from './inject';\nimport {UserStore} from './user/UserStore';\nimport {MessagesStore} from './message/MessagesStore';\nimport {ClientStore} from './client/ClientStore';\nimport {PluginStore} from './plugin/PluginStore';\nimport {registerReactions} from './reactions';\n\nconst devUrl = 'http://localhost:3000/';\n\nconst {port, hostname, protocol, pathname} = window.location;\nconst slashes = protocol.concat('//');\nconst path = pathname.endsWith('/') ? pathname : pathname.substring(0, pathname.lastIndexOf('/'));\nconst url = slashes.concat(port ? hostname.concat(':', port) : hostname) + path;\nconst urlWithSlash = url.endsWith('/') ? url : url.concat('/');\n\nconst prodUrl = urlWithSlash;\n\nconst initStores = (): StoreMapping => {\n const snackManager = new SnackManager();\n const appStore = new AppStore(snackManager.snack);\n const userStore = new UserStore(snackManager.snack);\n const messagesStore = new MessagesStore(appStore, snackManager.snack);\n const currentUser = new CurrentUser(snackManager.snack);\n const clientStore = new ClientStore(snackManager.snack);\n const wsStore = new WebSocketStore(snackManager.snack, currentUser);\n const pluginStore = new PluginStore(snackManager.snack);\n appStore.onDelete = () => messagesStore.clearAll();\n\n return {\n appStore,\n snackManager,\n userStore,\n messagesStore,\n currentUser,\n clientStore,\n wsStore,\n pluginStore,\n };\n};\n\n(function clientJS() {\n if (process.env.NODE_ENV === 'production') {\n config.set('url', prodUrl);\n } else {\n config.set('url', devUrl);\n config.set('register', true);\n }\n const stores = initStores();\n initAxios(stores.currentUser, stores.snackManager.snack);\n\n registerReactions(stores);\n\n stores.currentUser.tryAuthenticate().catch(() => {});\n\n window.onbeforeunload = () => {\n stores.wsStore.close();\n };\n\n ReactDOM.render(\n \n \n ,\n document.getElementById('root')\n );\n unregister();\n})();\n","import axios from 'axios';\nimport {CurrentUser} from './CurrentUser';\nimport {SnackReporter} from './snack/SnackManager';\n\nexport const initAxios = (currentUser: CurrentUser, snack: SnackReporter) => {\n axios.interceptors.request.use((config) => {\n config.headers['X-Gotify-Key'] = currentUser.token();\n return config;\n });\n\n axios.interceptors.response.use(undefined, (error) => {\n if (!error.response) {\n snack('Gotify server is not reachable, try refreshing the page.');\n return Promise.reject(error);\n }\n\n const status = error.response.status;\n\n if (status === 401) {\n currentUser.tryAuthenticate().then(() => snack('Could not complete request.'));\n }\n\n if (status === 400 || status === 403 || status === 500) {\n snack(error.response.data.error + ': ' + error.response.data.errorDescription);\n }\n\n return Promise.reject(error);\n });\n};\n","export function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister();\n });\n }\n}\n"],"sourceRoot":""}