{"version":3,"sources":["App.js","reportWebVitals.js","index.js"],"names":["getImages","query","a","fetch","method","body","JSON","stringify","headers","resp","json","App","useState","setQuery","images","setImages","search","results","className","class","id","type","onChange","evt","target","value","placeholder","onClick","map","image","href","link","src","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"mRAIMA,EAAS,uCAAG,WAAMC,GAAN,eAAAC,EAAA,4DAGJ,sCAHI,SAKGC,MAFP,sCAEkB,CAE5BC,OAAQ,OAERC,KAAMC,KAAKC,UAAU,CAAEN,UAGvBO,QAAS,CAAE,eAAgB,sBAZb,cAKVC,EALU,yBAeTA,EAAKC,QAfI,2CAAH,sDAmDAC,MAjCf,WAEE,MAA0BC,mBAAS,IAAnC,mBAAOX,EAAP,KAAcY,EAAd,KAEA,EAA4BD,mBAAS,IAArC,mBAAOE,EAAP,KAAeC,EAAf,KAIMC,EAAM,uCAAG,4BAAAd,EAAA,sEACSF,EAAUC,GADnB,OACPgB,EADO,OAEbF,EAAUE,GAFG,2CAAH,qDAQZ,OACE,sBAAKC,UAAU,MAAf,UACE,sBAAKC,MAAM,OAAX,UACE,uBAAOC,GAAG,QAAQC,KAAK,OAAOC,SALhB,SAAAC,GAAG,OAAIV,EAASU,EAAIC,OAAOC,QAKYC,YAAY,iBACjE,wBAAQC,QAASX,EAAjB,uBAIDF,EAAOc,KAAI,SAAAC,GAAK,OACf,mBAAkBC,KAAMD,EAAME,KAAMP,OAAO,SAA3C,SACE,qBAAKQ,IAAKH,EAAMA,SADVA,EAAMT,WCnCPa,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1Bb,M","file":"static/js/main.0ffc972d.chunk.js","sourcesContent":["import './App.css';\nimport { useState } from 'react'\n\n// A function to make requests to our Workers API using a query\nconst getImages = async query => {\n // The base URL for our API\n //console.log(query)\n const url = \"https://my-worker.luofu.workers.dev\"\n //const url = \"http://127.0.0.1:8787\"\n const resp = await fetch(url, {\n // Send a POST request\n method: \"POST\",\n // With a JSON-stringified body containing the query from our input\n body: JSON.stringify({ query }),\n // Set the `Content-type` header so our API knows that the request\n // is sending JSON\n headers: { 'Content-type': 'application/json' }\n })\n //console.log(resp)\n return resp.json()\n}\n\nfunction App() {\n // Store the query that we'll search for in a simple useState hook\n const [query, setQuery] = useState(\"\")\n // Store the array of images from the API in an array\n const [images, setImages] = useState([])\n\n // When the search button is clicked, make a request to the API\n // and set the response from it as our images array\n const search = async () => {\n const results = await getImages(query)\n setImages(results)\n }\n\n // When input#query changes, set query to the value of the input \n const updateQuery = evt => setQuery(evt.target.value)\n\n return (\n
\n
\n \n \n
\n\n {/* Map through the array of images and render a set of images */}\n {images.map(image =>\n \n \n \n )}\n
\n );\n}\n\nexport default App;\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":""}