{"version":3,"sources":["data/index.ts","settings.ts","api/index.ts","pages/Dashboard.tsx","pages/SessionPictures.tsx","pages/Session.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["clients","name","email","phone","activeSession","client","session","apiUrl","createClient","body","a","axios","post","getClient","id","settings","res","data","getSession","clientId","get","killSession","delete","Dashboard","history","useHistory","useState","setName","setEmail","setPhone","handleSubmit","e","preventDefault","push","parseInt","onSubmit","htmlFor","value","onChange","target","type","onClick","SessionPictures","pics","setPics","useEffect","interval","setInterval","previewPics","clearInterval","map","src","Session","props","match","params","submitted","setSubmitted","handleExit","handleNuke","className","App","path","component","exact","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"oQAEaA,EAAoB,CAC/B,CACEC,KAAM,SACNC,MAAO,oBACPC,MAAO,YAET,CACEF,KAAM,SACNC,MAAO,oBACPC,MAAO,WACPC,eAAe,IAGNC,EAAiBL,EAAQ,GAEzBM,EAAU,CACrB,gBACA,gBACA,gBACA,iBCrBa,EACR,OCIDC,EAAS,OAEFC,EAAY,uCAAG,WAAOC,GAAP,SAAAC,EAAA,sEACpBC,IAAMC,KAAN,UAAcL,EAAd,YAAgCE,GADZ,2CAAH,sDASZI,EAAS,uCAAG,WAAOC,GAAP,eAAAJ,EAAA,yDACF,SAAjBK,EADmB,yCACaV,GADb,uBAELM,IAAMC,KAAN,UAAsBL,EAAtB,mBAAuCO,IAFlC,cAEjBE,EAFiB,yBAGhBA,EAAIC,MAHY,2CAAH,sDAWTC,EAAU,uCAAG,WACxBC,GADwB,eAAAT,EAAA,yDAGH,SAAjBK,EAHoB,yCAGYT,GAHZ,uBAINK,IAAMS,IAAN,UAAab,EAAb,oBAA+BY,EAA/B,aAJM,cAIlBH,EAJkB,yBAKjBA,EAAIC,MALa,2CAAH,sDAQVI,EAAW,uCAAG,WAAOF,GAAP,SAAAT,EAAA,sEACnBC,IAAMW,OAAN,UAAgBf,E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,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1Bb,M","file":"static/js/main.3f5ea67c.chunk.js","sourcesContent":["import { Client } from '../types'\n\nexport const clients: Client[] = [\n {\n name: 'Elijah',\n email: 'elijah@elijah.com',\n phone: 4039876543,\n },\n {\n name: 'Tanner',\n email: 'tanner@tanner.com',\n phone: 4031234567,\n activeSession: true,\n },\n]\nexport const client: Client = clients[0]\n\nexport const session = [\n '/images/1.jpg',\n '/images/2.jpg',\n '/images/3.jpg',\n '/images/4.jpg',\n]\n","export default {\n env: 'prod',\n}\n","import { Client } from '../types'\nimport axios from 'axios'\nimport { client, clients, session } from '../data'\nimport settings from '../settings'\n\nconst apiUrl = '/api'\n\nexport const createClient = async (body: Client) => {\n await axios.post(`${apiUrl}/clients`, body)\n}\n\nexport const getClients = async (): Promise => {\n if (settings.env === 'jank') return clients\n const res = await axios.post(`${apiUrl}/clients`)\n return res.data\n}\nexport const getClient = async (id: string): Promise => {\n if (settings.env === 'jank') return client\n const res = await axios.post(`${apiUrl}/client/${id}`)\n return res.data\n}\nexport const startSession = async (clientId: string) => {\n //\n const res = await axios.post(`${apiUrl}/clients/${clientId}/session`)\n return res.data // session data\n}\n\nexport const getSession = async (\n clientId: string,\n): Promise => {\n if (settings.env === 'jank') return session\n const res = await axios.get(`${apiUrl}/clients/${clientId}/session`)\n return res.data as null | string[]\n}\n\nexport const killSession = async (clientId: string) => {\n await axios.delete(`${apiUrl}/clients/${clientId}/session`)\n}\n\nexport const restartSession = async (clientId: string) => {\n await killSession(clientId)\n await startSession(clientId)\n}\n\nexport const cleanup = () => {\n // send\n}\n","import React, { FormEvent } from 'react'\nimport { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { createClient } from '../api'\nimport settings from '../settings'\n\nexport const Dashboard = () => {\n const history = useHistory()\n const [name, setName] = useState('')\n const [email, setEmail] = useState('')\n const [phone, setPhone] = useState('')\n\n const handleReset = () => {\n //\n setName('')\n setEmail('')\n setPhone('')\n }\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault()\n\n if (settings.env === 'jank') {\n history.push(`/sessions/${phone}`)\n return\n }\n\n await createClient({ name, email, phone: parseInt(phone) })\n history.push(`/sessions/${phone}`)\n }\n\n return (\n
\n

Dashboard

\n
\n \n \n \n \n \n
\n
TODO: List of past sessions for review?
\n
\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { getSession } from '../api'\n\ntype Props = {\n clientId: string\n}\n\nexport const SessionPictures = ({ clientId }: Props) => {\n const [pics, setPics] = useState(null)\n\n useEffect(() => {\n const get = async () => {\n if (pics) return\n const previewPics = await getSession(clientId)\n if (previewPics) setPics(previewPics)\n }\n\n const interval = setInterval(get, 300)\n\n return () => clearInterval(interval)\n }, [clientId, pics])\n\n return (\n
\n

Session Pictures

\n {pics && pics.map((src) => )}\n
\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { RouteComponentProps, useHistory } from 'react-router-dom'\nimport { getClient, killSession } from '../api'\nimport { SessionPictures } from './SessionPictures'\n\ntype Props = RouteComponentProps<{ clientId: string }>\n\nexport const Session = (props: Props) => {\n const history = useHistory()\n const { clientId } = props.match.params\n const [submitted, setSubmitted] = useState(false)\n\n const handleExit = async () => {\n history.push('/')\n }\n\n const handleNuke = async () => {\n await killSession(clientId)\n history.push('/')\n }\n\n useEffect(() => {\n const get = async () => {\n const { activeSession } = await getClient(clientId)\n if (activeSession) setSubmitted(true)\n }\n\n get()\n })\n\n return (\n
\n

Session for {clientId}

\n \n {submitted && }\n
\n \n \n
\n
\n )\n}\n","import React from 'react'\nimport './App.css'\n\nimport { BrowserRouter, Switch, Route } from 'react-router-dom'\nimport { Dashboard } from './pages/Dashboard'\nimport { Session } from './pages/Session'\n\nfunction App() {\n return (\n \n
\n \n \n \n \n
\n
\n )\n}\n\nexport default App\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}