{"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","ListItemAvatar","minWidth","Avatar","height","src","image","ListItemText","primary","placeholderItems","disabled","root","paper","drawerPaper","Divider","align","requestPermission","console","log","setState","ResponsiveDrawer","Drawer","open","xsDown","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","token","fUpload","fDelete","fEdit","noDelete","internal","ref","create","update","getByID","remove","Row","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","loaded","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","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,GAC5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2J,KAAKC,kBAG1DlK,QAAQ6K,OAAOzQ,MDmC1BgV,GAAkBpd,GAElBA,EAAO0E,YAAYkU,kBAAkBZ,OAAM,eAE3Cnd,OAAOgkB,eAAiB,WACpB7e,EAAOqd,QAAQtc,SAGnB+d,SACI,eAAC,GAAD,CAAgB9e,OAAQA,EAAxB,SACI,eAAC,GAAD,MAEJkU,SAAS6K,eAAe,SExExB,kBAAmB/W,WACnBA,UAAUgX,cAAcC,MAAMpP,MAAK,SAACqP,GAChCA,EAAaC,gBFgDzB,K","file":"static/js/main.c9d23f31.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 {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 {\n Button,\n Hidden,\n IconButton,\n Typography,\n ListItem,\n ListItemText,\n ListItemAvatar,\n Avatar,\n} 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 \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 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';\nimport LoadingSpinner from '../common/LoadingSpinner';\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 {!messagesStore.loaded(appId) ? (\n \n ) : hasMessages ? (\n
\n this.heights[m.id] || 1)}>\n {messages.map(this.renderMessage)}\n \n\n {hasMore ? : this.label(\"You've reached the end\")}\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 loaded = (appId: number) => this.stateOf(appId, /*create*/ false).loaded;\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":""}