{"version":3,"sources":["shared/Header.tsx","utils/utils.tsx","displaySecret/Result.tsx","shared/Expiration.tsx","createSecret/CreateSecret.tsx","displaySecret/Secret.tsx","displaySecret/Error.tsx","displaySecret/DisplaySecret.tsx","createSecret/Upload.tsx","Routes.tsx","shared/Features.tsx","shared/Attribution.tsx","theme.ts","App.tsx","i18n.tsx","index.tsx"],"names":["useStyles","makeStyles","theme","appBar","marginBottom","spacing","logo","verticalAlign","paddingLeft","Header","t","useTranslation","isOnUploadPage","useLocation","pathname","includes","classes","AppBar","position","color","className","Toolbar","Link","href","underline","Typography","variant","component","width","height","alt","src","Box","sx","marginLeft","Button","RouterLink","to","randomString","text","possible","i","charAt","randomInt","length","min","max","byteArray","Uint8Array","window","crypto","getRandomValues","range","Math","floor","backendDomain","process","REACT_APP_BACKEND_URL","postSecret","body","a","post","uploadFile","url","fetch","JSON","stringify","method","request","json","status","data","decryptMessage","passwords","format","decrypt","message","readArmored","r","encryptMessage","encrypt","fromText","Row","label","value","useCopyToClipboard","copy","copyToClipboard","TableRow","TableCell","error","onClick","icon","faCopy","padding","Result","uuid","password","prefix","customPassword","base","location","protocol","host","short","full","TableContainer","Table","TableBody","radioGroup","justifyContent","Expiration","props","FormControl","margin","FormLabel","rules","required","control","defaultValue","name","as","RadioGroup","row","root","FormControlLabel","labelPlacement","Radio","Error","Alert","severity","OneTime","Grid","item","Checkbox","id","inputRef","register","defaultChecked","SpecifyPasswordInput","InputLabel","TextField","fullWidth","type","inputProps","autoComplete","spellCheck","SpecifyPasswordToggle","FormGroup","CreateSecret","useForm","defaultValues","generateDecryptionKey","secret","errors","handleSubmit","watch","setError","clearErrors","useState","loading","setLoading","result","setResult","onSubmit","form","pw","parseInt","expiration","onetime","one_time","align","container","paddingTop","multiline","rows","autoFocus","onKeyDown","event","ctrlKey","key","placeholder","marginTop","alignItems","direction","p","pb","disabled","pre","backgroundColor","border","display","fontSize","borderRadius","wordWrap","wordBreak","Secret","fileName","useEffect","saveAs","Blob","header","paddingBottom","ErrorPage","fetcher","ok","DisplaySecret","useParams","paramsPassword","isFile","match","setPassword","setSecret","setFileName","invalidPassword","setInvalidPassword","useSWR","shouldRetryOnError","revalidateOnFocus","useAsync","filename","Container","maxWidth","xs","helperText","onChange","e","target","Upload","onDrop","useCallback","acceptedFiles","reader","FileReader","onabort","console","log","onerror","onload","armor","fromBinary","file","forEach","readAsArrayBuffer","useDropzone","maxSize","minSize","getRootProps","getInputProps","fileRejections","isDragActive","isFileTooLarge","code","size","faFileUpload","mt","Routes","path","exact","createStyles","feature","flexDirection","minHeight","featureHeader","divider","Features","Divider","title","faLock","faBomb","faDownload","faShareAlt","faUserAltSlash","faCodeBranch","Feature","md","Paper","children","attribution","Attribution","createMuiTheme","palette","primary","blueGrey","App","navigator","serviceWorker","getRegistrations","then","registrations","unregister","ThemeProvider","i18n","use","initReactI18next","Backend","init","backend","loadPath","fallbackLng","lng","debug","ns","defaultNS","keySeparator","interpolation","escapeValue","formatSeparator","appendNamespaceToMissingKey","ReactDOM","render","fallback","document","getElementById"],"mappings":"8PAYMA,EAAYC,aAAW,SAACC,GAAD,MAAY,CACvCC,OAAQ,CACNC,aAAcF,EAAMG,QAAQ,IAE9BC,KAAM,CACJC,cAAe,SACfC,YAAa,WAIJC,EAAS,WAAO,IACnBC,EAAMC,cAAND,EAEFE,EADWC,cACeC,SAASC,SAAS,UAI5CC,EAAUhB,IAChB,OACE,cAACiB,EAAA,EAAD,CAAQC,SAAS,SAASC,MAAM,cAAcC,UAAWJ,EAAQb,OAAjE,SACE,eAACkB,EAAA,EAAD,WACE,cAACC,EAAA,EAAD,CAAMC,KANQ,IAMIJ,MAAM,UAAUK,UAAU,OAA5C,SACE,eAACC,EAAA,EAAD,CAAYC,QAAQ,KAAKC,UAAU,MAAnC,mBAEE,qBACEP,UAAWJ,EAAQV,KACnBsB,MAAM,KACNC,OAAO,KACPC,IAAI,GACJC,IAAI,oBAIV,cAACC,EAAA,EAAD,CACEC,GAAI,CACFC,WAAY,QAFh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,EAAD,CAAYC,QAAQ,QAAQP,MAAM,gBAAgBwJ,MAAM,SAAxD,UACGjK,EAAE,cAAe,IAClB,cAACY,EAAA,EAAD,CAAMC,KAAK,mCAAX,+B,oBCbKrB,GAAQsR,aAAe,CAClCC,QAAS,CACPC,QAASC,QC6BEC,GAxBH,WAUV,MARI,kBAAmBC,WACrBA,UAAUC,cAAcC,mBAAmBC,MAAK,SAACC,GAAmB,IAAD,gBACtCA,GADsC,IACjE,2BAA0C,SAC3BC,cAFkD,kCAQnE,cAACC,EAAA,EAAD,CAAejS,MAAOA,GAAtB,SACE,eAAC,IAAD,WACE,cAAC,EAAD,IACA,eAAC2N,EAAA,EAAD,CAAWC,SAAU,KAArB,UACE,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,a,4BCtBVsE,KACGC,IAAIC,MACJD,IAAIE,MACJC,KAAK,CACJC,QAAS,CACPC,SAAmC,yBAGrCC,YAAa,KACbC,IAAK,KACLC,OAAO,EAGPC,GAAI,CAAC,gBACLC,UAAW,eAEXC,cAAc,EAEdC,cAAe,CACbC,aAAa,EACbC,gBAAiB,KAGnBC,6BAA6B,IAGlBhB,GAAf,EC1BAiB,IAASC,OACP,cAAC,WAAD,CAAUC,SAAU,6CAApB,SACE,cAAC,GAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.0d98ed77.chunk.js","sourcesContent":["import {\n AppBar,\n Toolbar,\n Typography,\n Button,\n Box,\n makeStyles,\n Link,\n} from '@material-ui/core';\nimport { useTranslation } from 'react-i18next';\nimport { Link as RouterLink, useLocation } from 'react-router-dom';\n\nconst useStyles = makeStyles((theme) => ({\n appBar: {\n marginBottom: theme.spacing(4),\n },\n logo: {\n verticalAlign: 'middle',\n paddingLeft: '5px',\n },\n}));\n\nexport const Header = () => {\n const { t } = useTranslation();\n const location = useLocation();\n const isOnUploadPage = location.pathname.includes('upload');\n const base = process.env.PUBLIC_URL || '';\n const home = base + '/';\n const upload = base + '/upload';\n const classes = useStyles();\n return (\n \n \n \n \n Yopass\n \n \n \n \n \n {isOnUploadPage ? t('Home') : t('Upload')}\n \n \n \n \n );\n};\n","import { message, encrypt, decrypt, DecryptResult } from 'openpgp';\n\ntype Response = {\n // TODO: this shouldn't be any\n data: any;\n status: number;\n};\n\nexport const randomString = (): string => {\n let text = '';\n const possible =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (let i = 0; i < 22; i++) {\n text += possible.charAt(randomInt(0, possible.length));\n }\n return text;\n};\n\nconst randomInt = (min: number, max: number): number => {\n const byteArray = new Uint8Array(1);\n window.crypto.getRandomValues(byteArray);\n\n const range = max - min;\n const maxRange = 256;\n if (byteArray[0] >= Math.floor(maxRange / range) * range) {\n return randomInt(min, max);\n }\n return min + (byteArray[0] % range);\n};\n\nexport const backendDomain = process.env.REACT_APP_BACKEND_URL\n ? `${process.env.REACT_APP_BACKEND_URL}`\n : '';\n\nexport const postSecret = async (body: any): Promise => {\n return post(backendDomain + '/secret', body);\n};\n\nexport const uploadFile = async (body: any): Promise => {\n return post(backendDomain + '/file', body);\n};\n\nconst post = async (url: string, body: any): Promise => {\n const request = await fetch(url, {\n body: JSON.stringify(body),\n method: 'POST',\n });\n return { data: await request.json(), status: request.status };\n};\n\nexport const decryptMessage = async (\n data: string,\n passwords: string,\n format: 'utf8' | 'binary',\n): Promise => {\n const r = await decrypt({\n message: await message.readArmored(data),\n passwords,\n format,\n });\n return r;\n};\n\nexport const encryptMessage = async (\n data: string,\n passwords: string,\n): Promise => {\n const r = await encrypt({\n message: message.fromText(data),\n passwords,\n });\n return r.data as string;\n};\n\nexport default randomString;\n","import { faCopy } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useCopyToClipboard } from 'react-use';\nimport {\n Button,\n Typography,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableRow,\n Box,\n} from '@material-ui/core';\nimport { useTranslation } from 'react-i18next';\n\ntype ResultProps = {\n readonly uuid: string;\n readonly password: string;\n readonly prefix: 's' | 'f';\n readonly customPassword?: boolean;\n};\n\nconst Result = ({ uuid, password, prefix, customPassword }: ResultProps) => {\n const base =\n (process.env.PUBLIC_URL ||\n `${window.location.protocol}//${window.location.host}`) + `/#/${prefix}`;\n const short = `${base}/${uuid}`;\n const full = `${short}/${password}`;\n const { t } = useTranslation();\n\n return (\n \n {t('Secret stored in database')}\n \n {t(\n 'Remember that the secret can only be downloaded once so do not open the link yourself.',\n )}\n
\n {t(\n 'The cautious should send the decryption key in a separate communication channel.',\n )}\n
\n \n \n \n {!customPassword && (\n \n )}\n \n \n \n
\n
\n
\n );\n};\n\ntype RowProps = {\n readonly label: string;\n readonly value: string;\n};\n\nconst Row = ({ label, value }: RowProps) => {\n const [copy, copyToClipboard] = useCopyToClipboard();\n return (\n \n \n copyToClipboard(value)}\n >\n \n \n \n \n {label}\n \n {value}\n \n );\n};\n\nexport default Result;\n","import { Controller, UseFormMethods } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport {\n FormControl,\n FormControlLabel,\n FormLabel,\n makeStyles,\n Radio,\n RadioGroup,\n} from '@material-ui/core';\n\nconst useStyles = makeStyles({\n radioGroup: {\n justifyContent: 'center',\n },\n});\n\nexport const Expiration = (props: { control: UseFormMethods['control'] }) => {\n const { t } = useTranslation();\n const classes = useStyles();\n return (\n \n \n {t('The encrypted message will be deleted automatically after')}\n \n \n }\n label={t('One Hour')}\n />\n }\n label={t('One Day')}\n />\n }\n label={t('One Week')}\n />\n \n }\n />\n \n );\n};\nexport default Expiration;\n","import { useTranslation } from 'react-i18next';\nimport { useForm, UseFormMethods } from 'react-hook-form';\nimport randomString, { encryptMessage, postSecret } from '../utils/utils';\nimport { useState } from 'react';\nimport Result from '../displaySecret/Result';\nimport Expiration from './../shared/Expiration';\nimport {\n Alert,\n Checkbox,\n FormGroup,\n FormControlLabel,\n TextField,\n Typography,\n Button,\n Grid,\n Box,\n InputLabel,\n} from '@material-ui/core';\n\nconst CreateSecret = () => {\n const { t } = useTranslation();\n const {\n control,\n register,\n errors,\n handleSubmit,\n watch,\n setError,\n clearErrors,\n } = useForm({\n defaultValues: {\n generateDecryptionKey: true,\n secret: '',\n },\n });\n const [loading, setLoading] = useState(false);\n const [result, setResult] = useState({\n password: '',\n uuid: '',\n customPassword: false,\n });\n\n const onKeyDown = (event: React.KeyboardEvent): void => {\n if (event.ctrlKey && event.key === 'Enter') {\n handleSubmit(onSubmit)();\n }\n };\n\n const onSubmit = async (form: any): Promise => {\n // Use the manually entered password, or generate one\n const pw = form.password ? form.password : randomString();\n setLoading(true);\n try {\n const { data, status } = await postSecret({\n expiration: parseInt(form.expiration),\n message: await encryptMessage(form.secret, pw),\n one_time: form.onetime,\n });\n\n if (status !== 200) {\n setError('secret', { type: 'submit', message: data.message });\n } else {\n setResult({\n customPassword: form.password ? true : false,\n password: pw,\n uuid: data.message,\n });\n }\n } catch (e) {\n setError('secret', { type: 'submit', message: e.message });\n }\n setLoading(false);\n };\n\n const generateDecryptionKey = watch('generateDecryptionKey');\n\n if (result.uuid) {\n return (\n \n );\n }\n\n return (\n <>\n clearErrors('secret')}\n />\n \n {t('Encrypt message')}\n \n
\n \n \n \n \n \n \n \n \n {!generateDecryptionKey && (\n \n )}\n \n \n \n \n \n \n \n
\n \n );\n};\n\nexport const Error = (props: { message?: string; onClick?: () => void }) =>\n props.message ? (\n \n {props.message}\n \n ) : null;\n\nexport const OneTime = (props: { register: UseFormMethods['register'] }) => {\n const { t } = useTranslation();\n return (\n \n \n }\n label={t('One-time download')}\n />\n \n );\n};\n\nexport const SpecifyPasswordInput = (props: {\n register: UseFormMethods['register'];\n}) => {\n const { t } = useTranslation();\n return (\n \n {t('Custom decryption key')}\n \n \n );\n};\n\nexport const SpecifyPasswordToggle = (props: {\n register: UseFormMethods['register'];\n}) => {\n const { t } = useTranslation();\n return (\n \n \n }\n label={t('Generate decryption key')}\n />\n \n );\n};\n\nexport default CreateSecret;\n","import { useTranslation } from 'react-i18next';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCopy } from '@fortawesome/free-solid-svg-icons';\nimport { Button, Typography, makeStyles } from '@material-ui/core';\nimport { useCopyToClipboard } from 'react-use';\nimport { saveAs } from 'file-saver';\nimport { useEffect } from 'react';\n\nconst useStyles = makeStyles(() => ({\n pre: {\n backgroundColor: '#ecf0f1',\n padding: '15px',\n border: '1px solid #cccccc',\n display: 'block',\n fontSize: '14px',\n borderRadius: '4px',\n wordWrap: 'break-word',\n wordBreak: 'break-all',\n },\n}));\n\nconst Secret = ({\n secret,\n fileName,\n}: {\n readonly secret: string;\n readonly fileName?: string;\n}) => {\n const { t } = useTranslation();\n const [copy, copyToClipboard] = useCopyToClipboard();\n const classes = useStyles();\n\n useEffect(() => {\n fileName &&\n saveAs(\n new Blob([secret], {\n type: 'application/octet-stream',\n }),\n fileName,\n );\n }, [fileName, secret]);\n\n if (fileName) {\n return (\n
\n {t('File downloaded')}\n
\n );\n }\n return (\n
\n {t('Decrypted Message')}\n \n {t(\n 'This secret might not be viewable again, make sure to save it now!',\n )}\n \n copyToClipboard(secret)}\n >\n {t('Copy')}\n \n
\n        {secret}\n      
\n
\n );\n};\n\nexport default Secret;\n","import { useTranslation } from 'react-i18next';\nimport { makeStyles, Typography } from '@material-ui/core';\n\nconst useStyles = makeStyles((theme) => ({\n header: {\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n}));\n\nconst ErrorPage = (props: { error?: Error }) => {\n const { t } = useTranslation();\n const classes = useStyles();\n if (!props.error) {\n return null;\n }\n\n return (\n
\n {t('Secret does not exist')}\n \n {t('It might be caused by any of these reasons.')}\n \n
\n \n {t('Opened before')}\n \n \n {t(\n 'A secret can be restricted to a single download. It might be lost because the sender clicked this link before you viewed it.',\n )}\n
\n {t(\n 'The secret might have been compromised and read by someone else. You should contact the sender and request a new secret.',\n )}\n\n \n {t('Broken link')}\n \n {t(\n 'The link must match perfectly in order for the decryption to work, it might be missing some magic digits.',\n )}\n \n {t('Expired')}\n \n {t(\n 'No secret last forever. All stored secrets will expires and self destruct automatically. Lifetime varies from one hour up to one week.',\n )}\n
\n
\n );\n};\nexport default ErrorPage;\n","import { useState } from 'react';\nimport { useLocation, useParams } from 'react-router-dom';\nimport useSWR from 'swr';\nimport { backendDomain, decryptMessage } from '../utils/utils';\nimport Secret from './Secret';\nimport ErrorPage from './Error';\nimport {\n Container,\n Grid,\n TextField,\n Button,\n Typography,\n} from '@material-ui/core';\nimport { useTranslation } from 'react-i18next';\nimport { useAsync } from 'react-use';\n\nconst fetcher = async (url: string) => {\n const request = await fetch(url);\n if (!request.ok) {\n throw new Error('Failed to fetch secret');\n }\n const data = await request.json();\n return data.message;\n};\n\nconst DisplaySecret = () => {\n const { key, password: paramsPassword } = useParams<{\n key: string;\n password: string;\n }>();\n const location = useLocation();\n const isFile = null !== location.pathname.match(/\\/d|f\\//);\n const [password, setPassword] = useState(\n paramsPassword ? paramsPassword : '',\n );\n const [secret, setSecret] = useState('');\n const [fileName, setFileName] = useState('');\n const [invalidPassword, setInvalidPassword] = useState(false);\n const { t } = useTranslation();\n\n const url = isFile\n ? `${backendDomain}/file/${key}`\n : `${backendDomain}/secret/${key}`;\n const { data, error } = useSWR(url, fetcher, {\n shouldRetryOnError: false,\n revalidateOnFocus: false,\n });\n\n useAsync(async () => {\n return decrypt();\n }, [paramsPassword, data]);\n\n const decrypt = async () => {\n if (!data || !password) {\n return;\n }\n try {\n const r = await decryptMessage(\n data,\n password,\n isFile ? 'binary' : 'utf8',\n );\n if (isFile) {\n setFileName(r.filename);\n }\n setSecret(r.data);\n } catch (e) {\n setInvalidPassword(true);\n return false;\n }\n return true;\n };\n\n if (error) return ;\n if (!data)\n return (\n \n {t('Fetching from database, please hold...')}\n \n );\n if (secret) {\n return ;\n }\n if (paramsPassword && !secret && !invalidPassword) {\n return (\n {t('Decrypting, please hold...')}\n );\n }\n\n return (\n \n \n \n Enter decryption key\n \n Do not refresh this window as secret might be restricted to one time\n download.\n \n \n \n setPassword(e.target.value)}\n inputProps={{ spellCheck: 'false', ['data-gramm']: 'false' }}\n />\n \n \n \n \n \n \n );\n};\n\nexport default DisplaySecret;\n","import { faFileUpload } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { encrypt, message } from 'openpgp';\nimport { useCallback, useState } from 'react';\nimport { useDropzone } from 'react-dropzone';\nimport {\n Error,\n OneTime,\n SpecifyPasswordToggle,\n SpecifyPasswordInput,\n} from './CreateSecret';\nimport Expiration from './../shared/Expiration';\nimport Result from '../displaySecret/Result';\nimport { randomString, uploadFile } from '../utils/utils';\nimport { useTranslation } from 'react-i18next';\nimport { useForm } from 'react-hook-form';\nimport { Grid, Typography } from '@material-ui/core';\n\nconst Upload = () => {\n const maxSize = 1024 * 500;\n const [error, setError] = useState('');\n const { t } = useTranslation();\n const [result, setResult] = useState({\n password: '',\n customPassword: false,\n uuid: '',\n });\n\n const { control, register, handleSubmit, watch } = useForm({\n defaultValues: {\n generateDecryptionKey: true,\n secret: '',\n password: '',\n expiration: '3600',\n onetime: true,\n },\n });\n\n const form = watch();\n const onDrop = useCallback(\n (acceptedFiles: File[]) => {\n const reader = new FileReader();\n reader.onabort = () => console.log('file reading was aborted');\n reader.onerror = () => console.log('file reading has failed');\n reader.onload = async () => {\n handleSubmit(onSubmit)();\n const pw = form.password ? form.password : randomString();\n const file = await encrypt({\n armor: true,\n message: message.fromBinary(\n new Uint8Array(reader.result as ArrayBuffer),\n acceptedFiles[0].name,\n ),\n passwords: pw,\n });\n const { data, status } = await uploadFile({\n expiration: parseInt(form.expiration),\n message: file.data,\n one_time: form.onetime,\n });\n\n if (status !== 200) {\n setError(data.message);\n } else {\n setResult({\n uuid: data.message,\n password: pw,\n customPassword: form.password ? true : false,\n });\n }\n };\n acceptedFiles.forEach((file) => reader.readAsArrayBuffer(file));\n },\n [form, handleSubmit],\n );\n\n const {\n getRootProps,\n getInputProps,\n fileRejections,\n isDragActive,\n } = useDropzone({\n maxSize,\n minSize: 0,\n onDrop,\n });\n\n const onSubmit = () => {};\n\n const isFileTooLarge =\n fileRejections.length > 0 &&\n fileRejections[0].errors[0].code === 'file-too-large';\n\n const generateDecryptionKey = watch('generateDecryptionKey');\n\n if (result.uuid) {\n return (\n \n );\n }\n return (\n \n {isFileTooLarge && }\n setError('')} />\n
\n
\n \n \n {t('Drop file to upload')}\n \n \n \n {t(\n 'File upload is designed for small files like ssh keys and certificates.',\n )}\n \n \n \n \n \n
\n\n \n \n \n \n \n \n \n {!generateDecryptionKey && (\n \n )}\n \n \n
\n
\n );\n};\n\nexport default Upload;\n","import { Route } from 'react-router-dom';\n\nimport CreateSecret from './createSecret/CreateSecret';\nimport DisplaySecret from './displaySecret/DisplaySecret';\nimport Upload from './createSecret/Upload';\n\nexport const Routes = () => {\n return (\n
\n \n \n \n \n \n \n
\n );\n};\n","import {\n faBomb,\n faCodeBranch,\n faDownload,\n faLock,\n faShareAlt,\n faUserAltSlash,\n IconDefinition,\n} from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useTranslation } from 'react-i18next';\nimport {\n createStyles,\n Grid,\n makeStyles,\n Paper,\n Typography,\n Divider,\n Box,\n} from '@material-ui/core';\n\nconst useStyles = makeStyles((theme) =>\n createStyles({\n feature: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: 230,\n padding: 16,\n },\n featureHeader: {\n padding: 10,\n },\n divider: {\n padding: theme.spacing(1),\n },\n header: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const Features = () => {\n const { t } = useTranslation();\n return (\n \n \n \n \n \n {t('Share Secrets Securely With Ease')}\n \n \n {t(\n 'Yopass is created to reduce the amount of clear text passwords stored in email and chat conversations by encrypting and generating a short lived link which can only be viewed once.',\n )}\n \n \n \n \n {t(\n 'Encryption and decryption are being made locally in the browser. The key is never stored with yopass.',\n )}\n \n \n {t(\n 'Encrypted messages have a fixed lifetime and will be deleted automatically after expiration.',\n )}\n \n \n {t(\n 'The encrypted message can only be downloaded once which reduces the risk of someone peaking your secrets.',\n )}\n \n \n {t(\n 'Yopass generates a unique one click link for the encrypted file or message. The decryption password can alternatively be sent separately.',\n )}\n \n \n {t(\n 'Sharing should be quick and easy; No additional information except the encrypted secret is stored in the database.',\n )}\n \n \n {t(\n 'Yopass encryption mechanism are built on open source software meaning full transparency with the possibility to audit and submit features.',\n )}\n \n \n );\n};\n\ntype FeatureProps = {\n readonly title: string;\n readonly icon: IconDefinition;\n readonly children: JSX.Element;\n};\n\nconst Feature = (props: FeatureProps) => {\n const classes = useStyles();\n return (\n \n \n \n \n {props.title}\n \n {props.children}\n \n \n );\n};\n","import { Container, Link, makeStyles, Typography } from '@material-ui/core';\nimport { useTranslation } from 'react-i18next';\n\nconst useStyles = makeStyles((theme) => ({\n attribution: {\n margin: theme.spacing(4),\n },\n}));\n\nexport const Attribution = () => {\n const { t } = useTranslation();\n const classes = useStyles();\n return (\n \n \n {t('Created by')}{' '}\n Johan Haals\n \n \n );\n};\n","import { createMuiTheme } from '@material-ui/core/styles';\nimport blueGrey from '@material-ui/core/colors/blueGrey';\n\nexport const theme = createMuiTheme({\n palette: {\n primary: blueGrey,\n },\n});\n","import { HashRouter as Router } from 'react-router-dom';\nimport { Container } from '@material-ui/core';\nimport { ThemeProvider } from '@material-ui/core/styles';\n\nimport { Header } from './shared/Header';\nimport { Routes } from './Routes';\nimport { Features } from './shared/Features';\nimport { Attribution } from './shared/Attribution';\nimport { theme } from './theme';\n\nconst App = () => {\n // TODO: Removed in future version.\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations().then((registrations) => {\n for (const registration of registrations) {\n registration.unregister();\n }\n });\n }\n\n return (\n \n \n
\n \n \n \n \n \n \n \n );\n};\n\nexport default App;\n","import i18n from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport Backend from 'i18next-http-backend';\n\ni18n\n .use(initReactI18next)\n .use(Backend)\n .init({\n backend: {\n loadPath: process.env.PUBLIC_URL + '/locales/{{lng}}.json',\n },\n\n fallbackLng: 'en',\n lng: 'en',\n debug: false,\n\n // have a common namespace used around the full app\n ns: ['translations'],\n defaultNS: 'translations',\n\n keySeparator: false, // we use content as keys\n\n interpolation: {\n escapeValue: false, // not needed for react!!\n formatSeparator: ',',\n },\n\n appendNamespaceToMissingKey: true,\n });\n\nexport default i18n;\n","import ReactDOM from 'react-dom';\nimport { Suspense } from 'react';\nimport App from './App';\nimport './i18n';\n\nReactDOM.render(\n Loading...}>\n \n ,\n document.getElementById('root'),\n);\n"],"sourceRoot":""}