{"version":3,"sources":["Components/Header.js","Components/Recipe.js","Components/Body.js","App.js","serviceWorker.js","index.js"],"names":["Header","className","role","aria-label","href","Recipe","label","image","source","url","yields","dietLabels","healthLabels","ingredientLines","calories","src","alt","map","dietLabel","key","healthLabel","ingredientLine","Body","useState","recipes","setRecipes","search","setSearch","query","setQuery","useEffect","fetchAPI","a","fetch","method","headers","apiResult","json","data","hits","onSubmit","e","preventDefault","type","placeholder","value","onChange","target","recipe","toString","slice","indexOf","App","Fragment","Boolean","window","location","hostname","match","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","console","message"],"mappings":"q0iGAuBeA,MApBf,WACC,OACC,yBAAKC,UAAU,UACd,yBAAKA,UAAU,YACd,wBAAIA,UAAU,QACZ,IACD,0BAAMC,KAAK,MAAMC,aAAW,gBAA5B,gBAFD,eAOA,4BAAQF,UAAU,WAAlB,kBAED,uBAAGG,KAAK,yCAAyCH,UAAU,gBAC1D,uBAAGA,UAAU,qB,0CCmCFI,MAjDf,YAUI,IATHC,EASE,EATFA,MACAC,EAQE,EARFA,MACAC,EAOE,EAPFA,OACAC,EAME,EANFA,IACAC,EAKE,EALFA,OACAC,EAIE,EAJFA,WACAC,EAGE,EAHFA,aACAC,EAEE,EAFFA,gBACAC,EACE,EADFA,SAEA,OACC,yBAAKb,UAAU,WACd,yBAAKc,IAAKR,EAAOS,IAAI,GAAGf,UAAU,kBAClC,wBAAIA,UAAU,SAASK,GAEvB,uBAAGF,KAAMK,EAAKR,UAAU,UACtBO,GAEF,0BAAMP,UAAU,SAASS,GACzB,wBAAIT,UAAU,YAAd,mBAA0Ca,GAC1C,wBAAIb,UAAU,eACZU,EAAWM,KAAI,SAACC,GAAD,OACf,wBAAIjB,UAAU,aAAakB,IAAKD,GAC9BA,OAIJ,wBAAIjB,UAAU,iBACZW,EAAaK,KAAI,SAACG,GAAD,OACjB,wBAAInB,UAAU,eAAekB,IAAKC,GAChCA,OAIJ,wBAAInB,UAAU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C,EAAOA,OAAOnC,wBCrDtBuC,MATf,WACC,OACC,kBAAC,IAAMC,SAAP,KACC,kBAAC,EAAD,MACA,kBAAC,EAAD,QCGiBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,EAAD,OAEFC,SAASC,eAAe,SDyHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACLC,QAAQD,MAAMA,EAAME,c","file":"static/js/main.e5769fc1.chunk.js","sourcesContent":["import React from \"react\";\r\nimport \"./Header.css\";\r\n\r\nfunction Header() {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t

\r\n\t\t\t\t\t{\" \"}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t🍔\r\n\t\t\t\t\t\r\n\t\t\t\t\tFood Monger\r\n\t\t\t\t

\r\n\t\t\t\tver. 2020.JUL\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default Header;\r\n","import React from \"react\";\r\nimport \"./Recipe.css\";\r\n\r\nfunction Recipe({\r\n\tlabel,\r\n\timage,\r\n\tsource,\r\n\turl,\r\n\tyields,\r\n\tdietLabels,\r\n\thealthLabels,\r\n\tingredientLines,\r\n\tcalories,\r\n}) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t\"\"\r\n\t\t\t

{label}

\r\n\r\n\t\t\t\r\n\t\t\t\t{source}\r\n\t\t\t\r\n\t\t\t{yields}\r\n\t\t\t

Total Calories: {calories}

\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default Recipe;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport \"./Body.css\";\r\nimport Recipe from \"./Recipe\";\r\n\r\nfunction Body() {\r\n\tconst [recipes, setRecipes] = useState([]);\r\n\tconst [search, setSearch] = useState();\r\n\tconst [query, setQuery] = useState();\r\n\r\n\tuseEffect(() => {\r\n\t\t// getRecepie();\r\n\t\tfetchAPI();\r\n\t}, [query]);\r\n\tconst getRecepie = async () => {\r\n\t\tconst testRecipe = await require(\"./Test.json\");\r\n\t\tawait setRecipes(testRecipe.hits);\r\n\t};\r\n\tconst fetchAPI = async () => {\r\n\t\tconst apiResult = await fetch(\r\n\t\t\t`https://edamam-recipe-search.p.rapidapi.com/search?q=${query}`,\r\n\t\t\t{\r\n\t\t\t\tmethod: \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"x-rapidapi-host\": \"edamam-recipe-search.p.rapidapi.com\",\r\n\t\t\t\t\t\"x-rapidapi-key\":\r\n\t\t\t\t\t\t\"2446f6e999msh87b27456c75e4f5p196058jsnf74efa6a255c\",\r\n\t\t\t\t},\r\n\t\t\t}\r\n\t\t);\r\n\t\tconst data = await apiResult.json();\r\n\t\tawait setRecipes(data.hits);\r\n\t};\r\n\tfunction updateQuery(e) {\r\n\t\te.preventDefault();\r\n\t\tsetQuery(search);\r\n\t}\r\n\tconst updateSearch = (e) => {\r\n\t\tsetSearch(e.target.value);\r\n\t};\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t\t{recipes.map((recipe) => (\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default Body;\r\n","import React from \"react\";\nimport \"./App.css\";\nimport Header from \"./Components/Header\";\nimport Body from \"./Components/Body\";\n\nfunction App() {\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\n\t\t\n\t);\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\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 subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\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.0/8 are 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 function register(config) {\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(process.env.PUBLIC_URL, window.location.href);\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/facebook/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. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\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://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\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 // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.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, config);\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\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}