{"version":3,"sources":["Result.tsx","utils.tsx","Create.tsx","Error.tsx","Form.tsx","DisplaySecret.tsx","Download.tsx","Features.tsx","Upload.tsx","App.tsx","i18n.tsx","registerServiceWorker.ts","index.tsx"],"names":["CopyField","props","Clipboard","name","target","document","getElementById","FormGroup","Label","label","className","Button","color","id","icon","faCopy","Input","readOnly","value","Result","uuid","password","prefix","base","window","location","protocol","host","short","customPassword","full","t","useTranslation","randomString","text","possible","i","charAt","randomInt","length","min","max","byteArray","Uint8Array","crypto","getRandomValues","range","Math","floor","BACKEND_DOMAIN","process","REACT_APP_BACKEND_URL","postSecret","body","a","post","uploadFile","url","fetch","JSON","stringify","method","request","json","status","data","decryptMessage","passwords","format","openpgp","readArmored","message","decrypt","r","encryptMessage","fromText","OneTime","onetime","setOnetime","type","onChange","checked","for","SpecifyPasswordToggle","specifyPassword","setSpecifyPassword","title","SpecifyPasswordInput","setPassword","placeholder","autoComplete","e","Lifetime","expiration","setExpiration","buttons","duration","push","key","check","inline","tag","FormText","Error","Alert","Create","useState","error","setError","secret","setSecret","loading","setLoading","setUUID","setPrefix","submit","pw","one_time","onClick","rows","autoFocus","disabled","size","block","display","Form","redirect","setRedirect","to","btoa","Col","sm","Secret","DisplaySecret","showError","useParams","isEncoded","useLocation","pathname","match","useCallback","atob","console","log","useEffect","DownloadSuccess","Download","file","saveAs","Blob","filename","Feature","children","Features","Container","Row","faLock","faBomb","faDownload","faShareAlt","faUserAltSlash","faCodeBranch","Upload","onDrop","React","acceptedFiles","reader","FileReader","onabort","onerror","onload","armor","fromBinary","result","forEach","readAsArrayBuffer","useDropzone","maxSize","minSize","getRootProps","getInputProps","fileRejections","isDragActive","isFileTooLarge","errors","code","faFileUpload","App","Navbar","dark","expand","NavbarBrand","href","width","height","alt","src","NavItem","NavLink","Routes","path","exact","component","Attribution","i18n","use","initReactI18next","Backend","init","backend","loadPath","fallbackLng","lng","debug","ns","defaultNS","keySeparator","interpolation","escapeValue","formatSeparator","appendNamespaceToMissingKey","isLocalhost","Boolean","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","state","controller","catch","ReactDOM","fallback","URL","toString","origin","addEventListener","response","headers","get","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"wWA0CMA,EAAY,SAChBC,GAUA,OAJA,IAAIC,IAAJ,WAAkBD,EAAME,KAAxB,MAAkC,CAChCC,OAAQ,kBAAMC,SAASC,eAAT,UAA2BL,EAAME,KAAjC,UAId,gBAACI,EAAA,EAAD,KACE,gBAACC,EAAA,EAAD,KAAQP,EAAMQ,OACd,uBAAKC,UAAU,oBACb,uBAAKA,UAAU,sBACb,gBAACC,EAAA,EAAD,CAAQC,MAAM,UAAUC,GAAE,UAAKZ,EAAME,KAAX,OACvB,IACD,gBAAC,IAAD,CAAiBW,KAAMC,QAG3B,gBAACC,EAAA,EAAD,CAAOC,UAAU,EAAMJ,GAAE,UAAKZ,EAAME,KAAX,MAAqBe,MAAOjB,EAAMiB,WAMpDC,EA9DA,SACblB,GAKI,IACImB,EAA2BnB,EAA3BmB,KAAMC,EAAqBpB,EAArBoB,SAAUC,EAAWrB,EAAXqB,OAClBC,EAAI,UAAMC,OAAOC,SAASC,SAAtB,aAAmCF,OAAOC,SAASE,KAAnD,cAA6DL,GACjEM,EAAK,UAAML,EAAN,YAAcH,GACnBS,EAA4B,MAAXP,GAA6B,MAAXA,EACnCQ,EAAI,UAAMF,EAAN,YAAeP,GACjBU,EAAMC,cAAND,EAER,OACE,2BACE,0BAAKA,EAAE,8BACP,yBACGA,EACC,0FAEF,2BACCA,EACC,sFAGFF,GACA,gBAAC,EAAD,CAAW1B,KAAK,OAAOM,MAAOsB,EAAE,kBAAmBb,MAAOY,IAE5D,gBAAC,EAAD,CAAW3B,KAAK,QAAQM,MAAOsB,EAAE,cAAeb,MAAOU,IACvD,gBAAC,EAAD,CAAWzB,KAAK,MAAMM,MAAOsB,EAAE,kBAAmBb,MAAOG,M,QCn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C9B,IAAMlB,EAAK,UAAM/K,GAAN,sBAEP2K,KAmDV,SAAiCI,GAE/BvK,MAAMuK,GACHI,MAAK,SAAAe,GAGkB,MAApBA,EAASpL,SACwD,IAAjEoL,EAASC,QAAQC,IAAI,gBAAiBC,QAAQ,cAG9CrB,UAAUC,cAAcqB,MAAMnB,MAAK,SAAAC,GACjCA,EAAamB,aAAapB,MAAK,WAC7B7M,OAAOC,SAASiO,eAKpB1B,GAAgBC,MAGnBY,OAAM,WACL/F,QAAQC,IACN,oEAvEA4G,CAAwB1B,GAIxBC,UAAUC,cAAcqB,MAAMnB,MAAK,WACjCvF,QAAQC,IACN,gHAMJiF,GAAgBC,OCtCxB2B,I","file":"static/js/main.8b6337d1.chunk.js","sourcesContent":["import { faCopy } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Clipboard from 'clipboard';\nimport * as React from 'react';\nimport { Button, FormGroup, Input, Label } from 'reactstrap';\nimport { useTranslation } from 'react-i18next';\n\nconst Result = (\n props: {\n readonly uuid: string;\n readonly password: string;\n readonly prefix: string;\n } & React.HTMLAttributes,\n) => {\n const { uuid, password, prefix } = props;\n const base = `${window.location.protocol}//${window.location.host}/#/${prefix}`;\n const short = `${base}/${uuid}`;\n const customPassword = prefix === 'c' || prefix === 'd';\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 {!customPassword && (\n \n )}\n \n \n
\n );\n};\n\nconst CopyField = (\n props: {\n readonly label: string;\n readonly name: string;\n readonly value: string;\n } & React.HTMLAttributes,\n) => {\n new Clipboard(`#${props.name}-b`, {\n target: () => document.getElementById(`${props.name}-i`) as Element,\n });\n\n return (\n \n \n
\n
\n \n
\n \n
\n
\n );\n};\n\nexport default Result;\n","import * as openpgp from 'openpgp';\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 BACKEND_DOMAIN = process.env.REACT_APP_BACKEND_URL\n ? `${process.env.REACT_APP_BACKEND_URL}`\n : '';\n\nexport const postSecret = async (body: any) => {\n return post(BACKEND_DOMAIN + '/secret', body);\n};\n\nexport const uploadFile = async (body: any) => {\n return post(BACKEND_DOMAIN + '/file', body);\n};\n\nconst post = async (url: string, body: any) => {\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) => {\n const r = await openpgp.decrypt({\n message: await openpgp.message.readArmored(data),\n passwords,\n format,\n });\n return r;\n};\n\nexport const encryptMessage = async (data: string, passwords: string) => {\n const r = await openpgp.encrypt({\n message: openpgp.message.fromText(data),\n passwords,\n });\n return r.data as string;\n};\n\nexport default randomString;\n","import * as React from 'react';\nimport { useState } from 'react';\nimport {\n Alert,\n Button,\n Form,\n FormGroup,\n FormText,\n Input,\n Label,\n} from 'reactstrap';\nimport Result from './Result';\nimport { encryptMessage, postSecret, randomString } from './utils';\nimport { useTranslation } from 'react-i18next';\n\nconst Create = () => {\n const [expiration, setExpiration] = useState(3600);\n const [error, setError] = useState('');\n const [secret, setSecret] = useState('');\n const [onetime, setOnetime] = useState(true);\n const [loading, setLoading] = useState(false);\n const [uuid, setUUID] = useState('');\n const [prefix, setPrefix] = useState('');\n const [password, setPassword] = useState('');\n const [specifyPassword, setSpecifyPassword] = useState(false);\n\n const { t } = useTranslation();\n\n const setSpecifyPasswordAndUpdatePassword = (customPassword: boolean) => {\n setSpecifyPassword(customPassword);\n if (!customPassword) {\n // Clear the manual password if it should be generated.\n setPassword('');\n }\n };\n\n const submit = async () => {\n if (!secret) {\n return;\n }\n setLoading(true);\n setError('');\n try {\n // Use the manually entered password, or generate one\n const pw = password.length ? password : randomString();\n const { data, status } = await postSecret({\n expiration,\n message: await encryptMessage(secret, pw),\n one_time: onetime,\n });\n if (status !== 200) {\n setError(data.message);\n } else {\n setUUID(data.message);\n setPrefix(password.length ? 'c' : 's');\n setPassword(pw);\n }\n } catch (e) {\n setError(e.message);\n }\n setLoading(false);\n };\n\n return (\n
\n

{t('Encrypt message')}

\n setError('')} />\n {uuid ? (\n \n ) : (\n
\n \n \n setSecret(e.target.value)}\n value={secret}\n />\n \n \n
\n \n \n
\n {specifyPassword ? (\n \n ) : (\n ''\n )}\n submit()}\n >\n {loading ? (\n {t('Encrypting message...')}\n ) : (\n {t('Encrypt Message')}\n )}\n \n \n )}\n
\n );\n};\n\nexport const OneTime = (\n props: {\n readonly onetime: boolean;\n readonly setOnetime: React.Dispatch>;\n } & React.HTMLAttributes,\n) => {\n const { t } = useTranslation();\n const { onetime, setOnetime } = props;\n return (\n \n setOnetime(!onetime)}\n checked={onetime}\n />\n \n \n );\n};\nexport const SpecifyPasswordToggle = (\n props: {\n readonly specifyPassword: boolean;\n readonly setSpecifyPassword: any;\n } & React.HTMLAttributes,\n) => {\n const { t } = useTranslation();\n const { specifyPassword, setSpecifyPassword } = props;\n\n return (\n \n setSpecifyPassword(!specifyPassword)}\n checked={!specifyPassword}\n title={t('The decryption key is randomly generated by default')}\n />\n \n {t('Generate decryption key')}\n \n \n );\n};\nexport const SpecifyPasswordInput = (\n props: {\n readonly password: string;\n readonly setPassword: React.Dispatch>;\n } & React.HTMLAttributes,\n) => {\n const { t } = useTranslation();\n const { password, setPassword } = props;\n\n return (\n \n setPassword(e.target.value)}\n value={password}\n />\n \n );\n};\nexport const Lifetime = (\n props: {\n readonly expiration: number;\n readonly setExpiration: React.Dispatch>;\n } & React.HTMLAttributes,\n) => {\n const { expiration, setExpiration } = props;\n const { t } = useTranslation();\n const buttons = [];\n for (const i of [\n {\n duration: 3600,\n name: '1h',\n text: t('One Hour'),\n },\n {\n duration: 86400,\n name: '1d',\n text: t('One Day'),\n },\n {\n duration: 604800,\n name: '1w',\n text: t('One Week'),\n },\n ]) {\n buttons.push(\n \n \n ,\n );\n }\n\n return (\n \n \n {t('The encrypted message will be deleted automatically after')}\n \n {buttons}\n \n );\n};\n\nexport const Error = (\n props: { readonly message: string } & React.HTMLAttributes,\n) =>\n props.message ? (\n \n {props.message}\n \n ) : null;\n\nexport default Create;\n","import * as React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nconst Error = (\n props: { readonly display: boolean } & React.HTMLAttributes,\n) => {\n const { t } = useTranslation();\n\n return props.display ? (\n
\n

{t(\"Secret does not exist\")}

\n

\n {t(\"It might be caused by any of these reasons.\")}\n

\n

{t(\"Opened before\")}

{t(\"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 {t(\"The secret might have been compromised and read by someone else. You should contact the sender and request a new secret.\")}\n

\n

{t(\"Broken link\")}

\n

\n {t(\"The link must match perfectly in order for the decryption to work, it might be missing some magic digits.\")}\n

\n

{t(\"Expired\")}

\n

\n {t(\"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 ) : null;\n};\nexport default Error;\n","import * as React from 'react';\nimport { useState } from 'react';\nimport { Redirect } from 'react-router-dom';\nimport { Button, Col, FormGroup, Input, Label } from 'reactstrap';\nimport { useTranslation } from 'react-i18next';\n\nconst Form = (\n props: {\n readonly display: boolean;\n readonly uuid: string | undefined;\n readonly prefix: string;\n } & React.HTMLAttributes,\n) => {\n const [password, setPassword] = useState('');\n const [redirect, setRedirect] = useState(false);\n const { t } = useTranslation();\n\n const doRedirect = () => {\n if (password) {\n setRedirect(true);\n }\n };\n\n if (redirect) {\n if (props.prefix === 'c' || props.prefix === 'd') {\n // Base64 encode the password to support special characters\n return (\n \n );\n }\n\n return ;\n }\n return props.display ? (\n \n \n \n setPassword(e.target.value)}\n />\n \n \n \n ) : null;\n};\nexport default Form;\n","import * as React from 'react';\nimport { useEffect, useState, useCallback } from 'react';\nimport { useLocation, useParams } from 'react-router-dom';\nimport Error from './Error';\nimport Form from './Form';\nimport { decryptMessage } from './utils';\nimport { useTranslation } from 'react-i18next';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCopy } from '@fortawesome/free-solid-svg-icons';\nimport { Button } from 'reactstrap';\nimport Clipboard from 'clipboard';\n\nconst DisplaySecret = () => {\n const [loading, setLoading] = useState(false);\n const [error, showError] = useState(false);\n const [secret, setSecret] = useState('');\n const { key, password } = useParams();\n const { t } = useTranslation();\n const location = useLocation();\n const isEncoded = null !== location.pathname.match(/\\/c\\//);\n\n const decrypt = useCallback(async () => {\n if (!password) {\n return;\n }\n setLoading(true);\n const url = process.env.REACT_APP_BACKEND_URL\n ? `${process.env.REACT_APP_BACKEND_URL}/secret`\n : '/secret';\n try {\n const request = await fetch(`${url}/${key}`);\n if (request.status === 200) {\n const data = await request.json();\n const r = await decryptMessage(\n data.message,\n isEncoded ? atob(password) : password,\n 'utf8',\n );\n setSecret(r.data as string);\n setLoading(false);\n return;\n }\n } catch (e) {\n console.log(e);\n }\n setLoading(false);\n showError(true);\n }, [isEncoded, password, key]);\n\n useEffect(() => {\n decrypt();\n }, [decrypt]);\n\n return (\n
\n {loading && (\n

\n {t(\n 'Fetching from database and decrypting in browser, please hold...',\n )}\n

\n )}\n \n \n
\n
\n );\n};\n\nconst Secret = (\n props: { readonly secret: string } & React.HTMLAttributes,\n) => {\n const { t } = useTranslation();\n new Clipboard('#copy-b', {\n target: () => document.getElementById('pre') as Element,\n });\n\n return props.secret ? (\n
\n

{t('Decrypted Message')}

\n {t('This secret might not be viewable again, make sure to save it now!')}\n \n
{props.secret}
\n
\n ) : null;\n};\n\nexport default DisplaySecret;\n","import { saveAs } from 'file-saver';\nimport * as React from 'react';\nimport { useEffect, useState, useCallback } from 'react';\nimport { useParams, useLocation } from 'react-router-dom';\nimport Error from './Error';\nimport Form from './Form';\nimport { decryptMessage } from './utils';\nimport { useTranslation } from 'react-i18next';\n\nconst Download = () => {\n const [loading, setLoading] = useState(false);\n const [error, showError] = useState(false);\n const { key, password } = useParams();\n const { t } = useTranslation();\n const location = useLocation();\n const isEncoded = null !== location.pathname.match(/\\/d\\//);\n\n const decrypt = useCallback(async () => {\n if (!password) {\n return;\n }\n setLoading(true);\n const url = process.env.REACT_APP_BACKEND_URL\n ? `${process.env.REACT_APP_BACKEND_URL}/file`\n : '/file';\n try {\n const request = await fetch(`${url}/${key}`);\n if (request.status === 200) {\n const data = await request.json();\n console.log(isEncoded);\n const file = await decryptMessage(\n data.message,\n isEncoded ? atob(password) : password,\n 'binary',\n );\n saveAs(\n new Blob([file.data as string], {\n type: 'application/octet-stream',\n }),\n file.filename,\n );\n setLoading(false);\n return;\n }\n } catch (e) {\n console.log(e);\n }\n setLoading(false);\n showError(true);\n }, [password, key, isEncoded]);\n\n useEffect(() => {\n decrypt();\n }, [decrypt]);\n\n return (\n
\n {loading && (\n

\n {t(\n 'Fetching from database and decrypting in browser, please hold...',\n )}\n

\n )}\n {!loading && password && !error && }\n \n \n
\n );\n};\n\nconst DownloadSuccess = () => {\n const { t } = useTranslation();\n return (\n
\n

{t('Downloading file and decrypting in browser, please hold...')}

\n

\n {t('Make sure to download the file since it is only available once')}\n

\n
\n );\n};\nexport default Download;\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 * as React from 'react';\nimport { Container, Row } from 'reactstrap';\nimport { useTranslation } from 'react-i18next';\n\nconst Features = () => {\n const { t } = useTranslation();\n return (\n \n
\n

{t(\"Share Secrets Securely With Ease\")}

\n

\n {t(\"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 {t(\"Encryption and decryption are being made locally in the browser. The key is never stored with yopass.\")}\n \n \n {t(\"Encrypted messages have a fixed lifetime and will be deleted automatically after expiration.\")}\n \n \n {t(\"The encrypted message can only be downloaded once which reduces the risk of someone peaking your secrets.\")}\n \n \n {t(\"Yopass generates a unique one click link for the encrypted file or message. The decryption password can alternatively be sent separately.\")}\n \n \n {t(\"Sharing should be quick and easy; No additional information except the encrypted secret is stored in the database.\")}\n \n \n {t(\"Yopass encryption mechanism are built on open source software meaning full transparancy with the possibility to audit and submit features.\")}\n \n \n \n );\n};\n\nconst Feature = (\n props: {\n readonly title: string;\n readonly icon: IconDefinition;\n } & React.HTMLAttributes,\n) => {\n return (\n

\n
\n
\n \n
\n
\n

{props.title}

\n

{props.children}

\n
\n
\n
\n );\n};\nexport default Features;\n","import { faFileUpload } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport * as openpgp from 'openpgp';\nimport * as React from 'react';\nimport { useState } from 'react';\nimport { useDropzone } from 'react-dropzone';\nimport {\n Error,\n Lifetime,\n OneTime,\n SpecifyPasswordToggle,\n SpecifyPasswordInput,\n} from './Create';\nimport Result from './Result';\nimport { randomString, uploadFile } from './utils';\nimport { useTranslation } from 'react-i18next';\nimport { Row } from 'reactstrap';\n\nconst Upload = () => {\n const maxSize = 1024 * 500;\n const [password, setPassword] = useState('');\n const [onetime, setOnetime] = useState(true);\n const [expiration, setExpiration] = useState(3600);\n const [error, setError] = useState('');\n const [uuid, setUUID] = useState('');\n const { t } = useTranslation();\n const [specifyPassword, setSpecifyPassword] = useState(false);\n const [prefix, setPrefix] = useState('');\n\n const setSpecifyPasswordAndUpdatePassword = (customPassword: boolean) => {\n setSpecifyPassword(customPassword);\n if (!customPassword) {\n // Clear the manual password if it should be generated.\n setPassword('');\n }\n };\n\n const onDrop = React.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 const pw = password.length ? password : randomString();\n const file = await openpgp.encrypt({\n armor: true,\n message: openpgp.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,\n message: file.data,\n one_time: onetime,\n });\n\n if (status !== 200) {\n setError(data.message);\n } else {\n setPrefix(password.length ? 'd' : 'f');\n setUUID(data.message);\n setPassword(pw);\n }\n };\n acceptedFiles.forEach((file) => reader.readAsArrayBuffer(file));\n },\n [expiration, onetime, password],\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 isFileTooLarge =\n fileRejections.length > 0 &&\n fileRejections[0].errors[0].code === 'file-too-large';\n\n return (\n
\n {isFileTooLarge && }\n setError('')} />\n {uuid ? (\n \n ) : (\n
\n
\n \n
\n

{t('Drop file to upload')}

\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 {specifyPassword ? (\n \n ) : (\n ''\n )}\n
\n )}\n
\n );\n};\n\nexport default Upload;\n","import * as React from 'react';\nimport { HashRouter as Router, Route } from 'react-router-dom';\nimport { Container, Navbar, NavbarBrand, NavItem, NavLink } from 'reactstrap';\n\nimport './App.scss';\nimport Create from './Create';\nimport DisplaySecret from './DisplaySecret';\nimport Download from './Download';\nimport Features from './Features';\nimport Upload from './Upload';\nimport { useTranslation } from 'react-i18next';\n\nclass App extends React.Component {\n public render() {\n return (\n \n \n \n Yopass \"\"\n \n \n Upload\n \n \n \n \n \n \n \n \n );\n }\n}\n\nconst Routes = () => {\n return (\n
\n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nconst Attribution = () => {\n const { t } = useTranslation();\n return (\n \n
\n {t('Created by')}{' '}\n {t('Johan Haals')}\n
\n
\n );\n};\n\nexport default App;\n","import i18n from \"i18next\";\nimport { initReactI18next } from 'react-i18next';\n\n\nimport Backend from 'i18next-http-backend';\n\ni18n\n .use(initReactI18next)\n .use(Backend)\n .init({\n\n backend: {\n loadPath: '/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});\n\nexport default i18n;\n","// tslint:disable:no-console\n// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the 'N+1' visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n process.env.PUBLIC_URL!,\n window.location.toString()\n );\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://goo.gl/SC7cgQ'\n );\n });\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker) {\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a 'New content is\n // available; please refresh.' message in your web app.\n console.log('New content is available; please refresh.');\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // 'Content is cached for offline use.' message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n }\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type')!.indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import * as React from 'react';\nimport { Suspense } from 'react';\nimport * as ReactDOM from 'react-dom';\nimport App from './App';\nimport \"./i18n\";\nimport registerServiceWorker from './registerServiceWorker';\n\nReactDOM.render(\n Loading...}>\n \n ,\ndocument.getElementById('root') as HTMLElement\n);\n\nregisterServiceWorker();\n"],"sourceRoot":""}