{"version":3,"sources":["components/Error.js","components/Fetching.js","lib/shapes.js","components/partials/AttributeRow.js","components/partials/Attributes.js","components/partials/FactorySelection.js","components/partials/FormFieldsForOwner.js","components/partials/Traits.js","components/framework.js","components/FactoryForm.js","components/FactoryMalfunction.js","components/icons/ExternalLinkIcon.js","components/ObjectCard.js","components/ObjectUnderConstruction.js","components/Factories.js","lib/api.js","App.js","lib/hooks.js","reportWebVitals.js","index.js"],"names":["Error","Fetching","attributesShape","PropTypes","shape","name","string","isRequired","traitsShape","attributes","arrayOf","traits","AttributeRow","props","Form","Row","Col","Label","Control","as","disabled","className","value","attribute","onChange","event","onChangeName","children","onChangeValue","Traits","useState","inputAttributes","setInputAttributes","remainingAttributeOptions","useMemo","a","b","bNames","Set","map","item","filter","has","attrDiff","attr","addAttribute","replaceAttribute","ii","replacement","newAttributes","slice","splice","Group","controlId","target","setAttributeName","setAttributeValue","length","displayName","blueprint","owner","association","factory","class_name","FactorySelection","options","label","list","autoComplete","id","FormFieldsForOwner","type","styles","StyleSheet","create","display","flexDirection","flexWrap","maxHeight","css","trait","Check","classes","classNames","x","join","buttons","justifyContent","FactoryForm","blueprints","inquiry","factoryInput","setFactoryInput","indexedBluePrints","items","func","indexed","forEach","indexBy","selectedBlueprint","validSelection","prevOwner","ref","useRef","useEffect","current","usePrevious","other","ownerType","ownerId","otherOwnerType","otherOwnerId","sameOwner","form","onSubmit","handleSubmit","Attributes","Button","variant","onClick","reset","startOver","FactoryMalfunction","message","Alert","ExternalLinkIcon","width","height","viewBox","stroke-width","stroke","fill","stroke-linecap","stroke-linejoin","points","d","active","boxShadow","object","border","borderRadius","padding","marginRight","position","cursor","transition","objectDetails","flex","objectTitle","borderBottom","marginBottom","ObjectCard","isNew","isActive","animationClass","new","activate","link","href","rel","Object","entries","ObjectUnderConstruction","overflow","objectList","margin","Factories","factories","constructing","setConstructing","error","setError","fetching","setFetching","newObjectIndex","setNewObjectIndex","objects","setObjects","selectedObjectIndex","setSelectedObjectIndex","factoryList","selectedObject","associationFactories","association_factories","find","f","factory_name","association_name","findAssociationFactory","data","url","submitPath","fetch","method","body","response","json","responseData","ok","handleResponseData","console","JSON","stringify","handleSubmitError","log","concat","handleObject","selectObject","preventDefault","submit","FormData","index","then","res","App","loadFn","dependencies","setResponse","asyncFetch","done","catch","useRemoteData","api","class","csrfToken","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"gSAQeA,MANf,WACE,OACE,wECIWC,MANf,WACE,OACE,sD,uDCFEC,EAAkBC,IAAUC,MAAM,CACtCC,KAAMF,IAAUG,OAAOC,aAGnBC,EAAcL,IAAUC,MAAM,CAClCC,KAAMF,IAAUG,OAAOC,a,GAGJJ,IAAUC,MAAM,CACnCK,WAAYN,IAAUO,QAAQR,GAC9BG,KAAMF,IAAUG,OAAOC,WACvBI,OAAQR,IAAUO,QAAQF,K,8BCoCbI,MA1Cf,SAAsBC,GACpB,OACE,eAACC,EAAA,EAAKC,IAAN,WACE,eAACC,EAAA,EAAD,WACE,cAACF,EAAA,EAAKG,MAAN,6BACA,eAACH,EAAA,EAAKI,QAAN,CACEC,GAAG,SACHC,SAAUP,EAAMO,SAChBf,KAAI,qBACJgB,UAAU,eACVC,MAAOT,EAAMU,UAAUlB,KACvBmB,SAAU,SAAAC,GAAK,OAAIZ,EAAMa,aAAaD,IANxC,UAQE,wBAAQH,MAAOT,EAAMU,UAAUlB,KAA/B,SAAsCQ,EAAMU,UAAUlB,OACrDQ,EAAMc,eAGX,eAACX,EAAA,EAAD,WACE,cAACF,EAAA,EAAKG,MAAN,oBACA,uBACEG,SAAUP,EAAMO,WAAaP,EAAMU,UAAUlB,KAC7CA,KAAI,sBACJgB,UAAU,eACVC,MAAOT,EAAMU,UAAUD,MACvBE,SAAU,SAAAC,GAAK,OAAIZ,EAAMe,cAAcH,aCiDlCI,MAjEf,SAAgBhB,GACd,IAAQJ,EAAeI,EAAfJ,WAER,EAA8Cq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9C,GAAY,GAOd,OAjBArE,qBAAU,WACRqE,GAAY,GACZ6C,IAAaN,KAAKK,GAAaG,MAAMjD,GAAUyC,KAAKO,KACnDH,GAUWtL,mBAAQ,WACpB,MAAO,CAACwI,QAAOE,WAAUuB,cACxB,CAACzB,EAAOE,EAAUuB,IDvBH0B,CAAcC,GAIhC,OAFAtH,qBAAU,WAAQgG,QAAQI,IAAIrC,KAAc,CAACA,IAG3C,sBAAKlJ,UAAU,MAAf,UACE,iCACE,qBAAK0M,MAAM,cAAX,uBAEF,iCACGxD,EAAUK,UAAY,cAAC,EAAD,IACtBL,EAAUG,OAAS,cAAC,EAAD,IACnBH,EAAU4B,UACT,cAAC,EAAD,CACE6B,UAAU,GACVjC,WAAW,UACXxB,UAAWA,EAAU4B,kBElBlB8B,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBf,MAAK,YAAkD,IAA/CgB,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BZ,M","file":"static/js/main.056013c5.chunk.js","sourcesContent":["import React from \"react\";\n\nfunction Error() {\n return (\n
86 on that ... something went wrong.
\n );\n}\n\nexport default Error;\n","import React from \"react\";\n\nfunction Fetching() {\n return (\n
Coming right up...
\n );\n}\n\nexport default Fetching;\n","import PropTypes from 'prop-types';\n\nconst attributesShape = PropTypes.shape({\n name: PropTypes.string.isRequired,\n});\n\nconst traitsShape = PropTypes.shape({\n name: PropTypes.string.isRequired,\n});\n\nconst factoryShape = PropTypes.shape({\n attributes: PropTypes.arrayOf(attributesShape),\n name: PropTypes.string.isRequired,\n traits: PropTypes.arrayOf(traitsShape),\n});\n\nexport {\n attributesShape,\n factoryShape,\n traitsShape,\n};\n","import React from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Col from \"react-bootstrap/Col\";\nimport Form from \"react-bootstrap/Form\";\n\nfunction AttributeRow(props) {\n return (\n \n \n Attribute Name\n props.onChangeName(event)}\n >\n \n {props.children}\n \n \n \n Value\n props.onChangeValue(event)}\n />\n \n \n );\n}\n\nAttributeRow.propTypes = {\n attribute: PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string,\n }),\n children: PropTypes.node,\n disabled: PropTypes.bool,\n onChangeName: PropTypes.func.isRequired,\n onChangeValue: PropTypes.func.isRequired,\n};\n\nexport default AttributeRow;\n","import React, { useMemo, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport AttributeRow from \"./AttributeRow\";\n\nimport { attributesShape } from \"lib/shapes\";\n\nfunction attrDiff(a, b) {\n const bNames = new Set(b.map(item => item.name));\n return a.filter(item => !bNames.has(item.name));\n}\n\nfunction Traits(props) {\n const { attributes } = props;\n\n const [inputAttributes, setInputAttributes] = useState([]);\n const remainingAttributes = useMemo(() => attrDiff(attributes, inputAttributes));\n\n const remainingAttributeOptions = remainingAttributes.map(attr => (\n \n ));\n\n function addAttribute({name, value}) {\n setInputAttributes([...inputAttributes, {name, value}]);\n }\n\n function setAttributeName(ii, event) {\n const replacement = {name: event.target.value, value: inputAttributes[ii].value};\n replaceAttribute(ii, replacement);\n }\n\n function setAttributeValue(ii, event) {\n const replacement = {name: inputAttributes[ii].name, value: event.target.value};\n replaceAttribute(ii, replacement);\n }\n\n function replaceAttribute(ii, replacement) {\n const newAttributes = inputAttributes.slice();\n newAttributes.splice(ii, 1, replacement);\n setInputAttributes(newAttributes);\n }\n\n return (\n \n Pickles or onions?\n\n {inputAttributes.map((attr, ii) => (\n setAttributeName(ii, event)}\n onChangeValue={event => setAttributeValue(ii, event)}\n >\n {remainingAttributeOptions}\n \n ))}\n\n addAttribute({name: event.target.value, value: \"\"})}\n onChangeValue={event => addAttribute({name: \"\", value: event.target.value})}\n >\n {remainingAttributeOptions}\n \n\n \n );\n}\n\nTraits.propTypes = {\n disabled: PropTypes.bool,\n attributes: PropTypes.arrayOf(attributesShape).isRequired,\n};\n\nexport default Traits;\n","import React from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport { factoryShape } from \"lib/shapes\";\n\nfunction displayName(blueprint, owner) {\n if (owner) {\n return `${blueprint.association} (${blueprint.factory.name}, ${blueprint.factory.class_name})`;\n } else {\n return `${blueprint.factory.name} (${blueprint.factory.class_name})` ;\n }\n}\n\nfunction FactorySelection(props) {\n const { options, label, value, onChange, owner } = props;\n return (\n \n {label}\n \n \n {options.map(blueprint => (\n \n ))}\n \n \n );\n}\n\nFactorySelection.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n factory: factoryShape.isRequired,\n association: PropTypes.string,\n })\n ).isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n label: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n};\n\nexport default FactorySelection;\n","import React from \"react\";\n\nimport PropTypes from 'prop-types';\n\nimport Form from \"react-bootstrap/Form\";\n\nfunction FormFieldsForOwner(props) {\n const { association, owner } = props;\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n );\n}\n\nFormFieldsForOwner.propTypes = {\n association: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n};\n\nexport default FormFieldsForOwner;\n","import React from \"react\";\n\nimport { StyleSheet, css } from \"aphrodite\";\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport { traitsShape } from \"lib/shapes\";\n\nfunction Traits(props) {\n const { traits } = props;\n\n return (\n \n How would you like that cooked?\n
\n {traits.map(trait => (\n \n ))}\n
\n
\n );\n}\n\nTraits.propTypes = {\n disabled: PropTypes.bool,\n traits: PropTypes.arrayOf(traitsShape).isRequired,\n};\n\nconst styles = StyleSheet.create({\n traits: {\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n maxHeight: \"6em\",\n },\n});\n\nexport default Traits;\n","import { useEffect, useRef } from \"react\";\n\nexport function classes(...classNames) {\n return classNames.filter(x => x).join(\" \");\n}\n\nexport function indexBy(items, func) {\n const indexed = {};\n items.forEach(item => indexed[func(item)] = item);\n return indexed;\n}\n\nexport function usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n","import React, { useEffect, useMemo, useState, useRef } from 'react';\n\nimport { css, StyleSheet } from 'aphrodite';\nimport PropTypes from 'prop-types';\n\nimport Button from \"react-bootstrap/Button\";\nimport Form from \"react-bootstrap/Form\";\n\nimport Attributes from \"./partials/Attributes\";\nimport FactorySelection from \"./partials/FactorySelection\";\nimport FormFieldsForOwner from \"./partials/FormFieldsForOwner\";\nimport Traits from \"./partials/Traits\";\n\nimport { factoryShape } from \"lib/shapes\";\nimport { indexBy, usePrevious } from \"./framework\";\n\nfunction FactoryForm(props) {\n const blueprints = props.blueprints || [];\n const owner = props.owner;\n const inquiry = props.inquiry || \"What'll it be?\";\n\n const [factoryInput, setFactoryInput] = useState(\"\");\n\n function handleFactory(event) {\n const value = event.target.value;\n setFactoryInput(value);\n }\n\n const indexedBluePrints = useMemo(() => indexBy(blueprints, blueprint => blueprint.factory.name), [blueprints]);\n const selectedBlueprint = useMemo(() => indexedBluePrints[factoryInput], [factoryInput]);\n const attributes = useMemo(() => selectedBlueprint && selectedBlueprint.factory.attributes || [], [selectedBlueprint]);\n const traits = useMemo(() => selectedBlueprint && selectedBlueprint.factory.traits || [], [selectedBlueprint]);\n const validSelection = !!selectedBlueprint;\n\n const prevOwner = usePrevious(props.owner);\n\n function sameOwner(owner, other) {\n const ownerType = owner && owner.type;\n const ownerId = owner && owner.id;\n const otherOwnerType = other && other.type;\n const otherOwnerId = other && other.id;\n return ownerType === otherOwnerType && ownerId == otherOwnerId;\n }\n\n useEffect(() => {\n if (!sameOwner(props.owner, prevOwner)) { setFactoryInput(\"\"); }\n }, [props.owner]);\n\n const form = useRef(null);\n\n function startOver() {\n form.current && form.current.reset();\n setFactoryInput(\"\");\n props.startOver();\n }\n\n return (\n
\n\n \n\n \n\n {traits.length > 0 && (\n \n )}\n\n {attributes.length > 0 && (\n \n )}\n\n
\n \n {' '}\n
\n \n );\n}\n\nFactoryForm.propTypes = {\n blueprints: PropTypes.arrayOf(\n PropTypes.shape({\n factory: factoryShape.isRequired,\n association: PropTypes.string,\n })\n ).isRequired,\n disabled: PropTypes.bool,\n handleSubmit: PropTypes.func,\n inquiry: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n startOver: PropTypes.func,\n};\n\nconst styles = StyleSheet.create({\n buttons: {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n});\n\nexport default FactoryForm;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport Alert from \"react-bootstrap/Alert\";\n\nfunction FactoryMalfunction(props) {\n const message = props.message || \"Something went wrong\";\n return (\n \n {message}\n \n );\n}\n\nFactoryMalfunction.propTypes = {\n message: PropTypes.string,\n};\n\nexport default FactoryMalfunction;\n","import React from \"react\";\n\nfunction ExternalLinkIcon() {\n return (\n \n \n \n \n \n \n )\n}\n\nexport default ExternalLinkIcon;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { StyleSheet, css } from \"aphrodite\";\n\nimport ExternalLinkIcon from \"./icons/ExternalLinkIcon\";\n\nimport { classes } from \"./framework\";\n\nfunction animationClass({ isNew, isActive }) {\n if (isNew) {\n return \"created\";\n } else if (isActive) {\n return \"selected\";\n } else {\n return null;\n }\n}\n\nfunction ObjectCard(props) {\n const { object = {} } = props;\n const attributes = object.attributes || {};\n const className = animationClass({isNew: props.new, isActive: props.active});\n return (\n
\n
\n {object.type}\n {object.link && (\n \n \n \n )}\n
\n
\n {Object.entries(attributes).map(([name, value]) => (\n
\n {`${name}: ${value}`}\n
\n ))}\n
\n
\n );\n}\n\nObjectCard.propTypes = {\n activate: PropTypes.func.isRequired,\n active: PropTypes.bool,\n new: PropTypes.bool,\n object: PropTypes.shape({\n attributes: PropTypes.object.isRequired,\n type: PropTypes.string.isRequired,\n link: PropTypes.string,\n }).isRequired,\n};\n\nconst styles = StyleSheet.create({\n active: {\n boxShadow: \"5px 5px 0px #333\",\n },\n object: {\n border: \"2px solid #222\",\n borderRadius: \"1em\",\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"0.5em\",\n marginRight: \"0.5em\",\n position: \"relative\",\n cursor: \"pointer\",\n transition: \"background-color 0.2s\",\n },\n objectDetails: {\n flex: 1,\n width: \"100%\",\n },\n objectTitle: {\n flex: 0,\n width: \"100%\",\n borderBottom: \"2px solid #222\",\n marginBottom: \"3px\",\n },\n});\n\nexport default ObjectCard;\n","import React from \"react\";\n\nimport ObjectCard from \"./ObjectCard\";\n\nfunction ObjectUnderConstruction() {\n return (\n
\n \n
\n );\n}\n\nexport default ObjectUnderConstruction;\n","import React, { useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { StyleSheet, css } from \"aphrodite\";\n\nimport { factoryShape } from \"lib/shapes\";\n\nimport FactoryForm from \"./FactoryForm\";\nimport FactoryMalfunction from \"./FactoryMalfunction\";\nimport ObjectCard from \"./ObjectCard\";\nimport ObjectUnderConstruction from \"./ObjectUnderConstruction.js\";\n\nfunction findAssociationFactory(factories, association) {\n return {\n factory: factories.find(f => f.name === association.factory_name),\n association: association.association_name,\n };\n}\n\nfunction objectId(object) {\n return {\n type: object.type,\n id: object.attributes.id,\n };\n}\n\nfunction Factories(props) {\n const { factories } = props;\n\n // Just use this for testing objects without having to create them\n // const staticObject = [{type: \"test\", attributes: {id: 1, name: \"first\"}}, {type: \"test\", attributes: {id: 1, name: \"second\"}}];\n const staticObject = [];\n\n const [constructing, setConstructing] = useState(false);\n const [error, setError] = useState(null);\n const [fetching, setFetching] = useState(false);\n const [newObjectIndex, setNewObjectIndex] = useState(null);\n const [objects, setObjects] = useState([...staticObject]);\n const [selectedObjectIndex, setSelectedObjectIndex] = useState(null);\n\n const factoryList = factories.map(factory => ({factory}));\n const selectedObject = selectedObjectIndex !== null && objects.length > 0 && objects[selectedObjectIndex];\n\n const associationFactories = useMemo(() => {\n if (!selectedObject || !selectedObject.association_factories) { return []; }\n const matchingFactories = selectedObject.association_factories.map(\n item => findAssociationFactory(factories, item)\n );\n return matchingFactories;\n }, [selectedObject]);\n\n const blueprints = selectedObject ? associationFactories : factoryList;\n const inquiry = selectedObject ? `Would you like fries with that ${selectedObject.type}?` : null;\n\n function startOver() {\n setNewObjectIndex(null);\n setNewObjectIndex(null);\n setObjects([]);\n setSelectedObjectIndex(null);\n }\n\n function selectObject(ii) {\n setNewObjectIndex(null);\n setSelectedObjectIndex(ii);\n }\n\n function handleSubmit(event) {\n event.preventDefault();\n setConstructing(true);\n setError(null);\n setFetching(true);\n const data = formData(event.target);\n submit(data);\n }\n\n async function submit(data) {\n const url = props.submitPath;\n\n const response = await fetch(url, {\n method: \"POST\",\n body: data,\n });\n\n const responseData = await response.json();\n\n if (!response.ok) {\n // eslint-disable-next-line no-console\n console.error(JSON.stringify(responseData));\n handleSubmitError(responseData.error || \"Uh oh, something broke.\");\n } else {\n handleResponseData(responseData);\n }\n }\n\n function handleResponseData(responseData) {\n if (responseData.ok) {\n // eslint-disable-next-line no-console\n console.log(JSON.stringify(responseData));\n handleObject(responseData.data);\n } else {\n // eslint-disable-next-line no-console\n console.error(responseData.error);\n handleSubmitError(responseData.error || \"Uh oh, something went wrong.\");\n }\n }\n\n function handleSubmitError(message) {\n setConstructing(false);\n setError(message);\n setFetching(false);\n }\n\n function handleObject(object) {\n setConstructing(false);\n setError(null);\n setFetching(false);\n setObjects(objects.slice().concat([object]));\n if (objects.length === 0) {\n setSelectedObjectIndex(0);\n }\n setNewObjectIndex(objects.length);\n }\n\n function formData(form) {\n return new FormData(form);\n }\n\n return (\n
\n

Order Up!

\n\n {(constructing || (objects.length > 0)) && (\n <>\n {constructing ? \"Comin' right up!\" : \"Here you go!\"}\n {objects.length > 1 && (\n {\" \"}P.S. -- select any object to build out its dependencies.\n )}\n
\n {objects.map((object, ii) => (\n selectObject(ii)}\n new={newObjectIndex === ii}\n />\n ))}\n {constructing && }\n
\n \n )}\n\n {error && }\n\n
\n \n
\n
\n );\n}\n\nFactories.propTypes = {\n factories: PropTypes.arrayOf(factoryShape),\n submitPath: PropTypes.string,\n};\n\nconst styles = StyleSheet.create({\n form: {\n marginBottom: \"2em\",\n transition: \"opacity 0.5s ease-out\",\n overflow: \"hidden\",\n },\n objectList: {\n display: \"flex\",\n margin: \"0.5em 0 1em\",\n },\n});\n\nexport default Factories;\n","export function index() {\n return fetch(\"./data\")\n .then(res => res.json());\n}\n","import { useEffect } from \"react\";\n\nimport './App.css';\nimport './burgers.css';\nimport './layout.css';\n\nimport Error from \"components/Error\";\nimport Fetching from \"components/Fetching\";\nimport Factories from \"components/Factories\";\n\nimport * as api from \"lib/api\";\nimport { useRemoteData } from \"lib/hooks\";\n\nfunction App() {\n const factories = useRemoteData(api.index);\n\n useEffect(() => { console.log(factories) }, [factories]);\n\n return (\n
\n
\n
testing
\n
\n
\n {factories.fetching && }\n {factories.error && }\n {factories.response && (\n \n )}\n
\n
\n );\n}\n\nexport default App;\n","// useRemoteData -- fetch remote data with standardized fetching and error states\n//\n// USAGE\n//\n// function fetchMyData() {\n// // ... return your data or a promise for your data ...\n// }\n//\n// const data = useRemoteData(fetchMyData);\n// // -- OR --\n// const data = useRemoteData(fetchMyData, dependencies);\n//\n// Similar to `useEffect`, `dependencies` will trigger the fetch to occur again.\n// `dependencies` defaults to [], meaning the fetch will happen only once.\n\n\nimport { useEffect, useMemo, useState } from \"react\";\nexport function useRemoteData(loadFn, dependencies = []) {\n const [error, setError] = useState(null);\n const [fetching, setFetching] = useState(dependencies.length === 0);\n const [response, setResponse] = useState(null);\n\n useEffect(() => {\n setFetching(true);\n asyncFetch().then(setResponse).catch(setError).then(done);\n }, dependencies);\n\n async function asyncFetch() {\n return loadFn();\n }\n\n function done() {\n setFetching(false);\n }\n\n const value = useMemo(() => {\n return {error, fetching, response};\n }, [error, fetching, response]);\n\n return value;\n}\n","const reportWebVitals = onPerfEntry => {\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":""}