{"version":3,"sources":["components/header.js","components/footer.js","components/likedTrack.js","App.js","serviceWorker.js","index.js"],"names":["Header","Component","render","className","Footer","LikedTrack","constructor","props","super","this","state","data","listOfTracks","class","href","src","alt","App","tracks","handleClickBool","fetch","then","response","json","user","trackInfo","trackList","forEach","t","push","track_name","track_artist","track_img","track_url","setState","onClick","handleClick","map","track","console","log","Boolean","window","location","hostname","match","ReactDOM","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"mQAEA,MAAMA,UAAeC,YACjBC,SACE,OACE,yBAAKC,UAAU,UACb,2CACA,iJAMKH,QCXf,MAAMI,UAAeH,YACjBC,SACI,OACE,yBAAKC,UAAU,UAAf,kHAOKC,QCVf,MAAMC,UAAmBJ,YACrBK,YAAYC,GACRC,MAAMD,GACNE,KAAKC,MAAQ,CACTC,KAAMF,KAAKF,MAAMK,cAGzBV,SACI,OACI,yBAAKW,MAAM,yBACP,uBAAGC,KAAML,KAAKC,MAAMC,KAAK,IAAzB,IAA8B,yBAAKI,IAAKN,KAAKC,MAAMC,KAAK,GAAIK,IAAI,KAAhE,KACA,2BAAIP,KAAKC,MAAMC,KAAK,GAApB,SAA2BF,KAAKC,MAAMC,KAAK,MAM5CN,Q,wBCZf,MAAMY,UAAYhB,YAAW,cAAD,yBAC1BS,MAAQ,CACNQ,OAAQ,GACRC,iBAAiB,GAGF,oBAQf,IAAID,QAAeE,IAAM,2CACxBC,KAAKC,GAAYA,EAASC,QAC1BF,KAAMG,GAEEA,EAAKN,QAMVO,EAAY,GACZC,EAAY,GAEhBR,EAAOS,QAASC,IACdH,EAAUI,KAAKD,EAAEE,YACjBL,EAAUI,KAAKD,EAAEG,cACjBN,EAAUI,KAAKD,EAAEI,WACjBP,EAAUI,KAAKD,EAAEK,WACjBP,EAAUG,KAAKJ,GACfA,EAAY,KAKdhB,KAAKyB,SAAS,CACZhB,OAAQQ,EACRP,iBAAiB,IAIrBjB,SACE,OACE,oCACE,yBAAKC,UAAU,gBACb,kBAAC,EAAD,MACA,yBAAKA,UAAU,iBACb,4GACA,8GACA,sFACA,4BAAQU,MAAM,mBAAmBsB,QAAS,IAAM1B,KAAK2B,eAArD,qBAIA,yBAAKjC,UAAU,8BAEbM,KAAKC,MAAMS,gBACRV,KAAKC,MAAMQ,OAAOmB,IAAKC,GAAU,kBAAC,EAAD,CAAY1B,aAAc0B,KAC5DC,QAAQC,IAAI/B,KAAKC,MAAMS,mBAK7B,kBAAC,EAAD,SAOKF,QCtEKwB,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCVNC,IAAS5C,OAAO,kBAAC,EAAD,MAAS6C,SAASC,eAAe,SDmH3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM9B,KAAK+B,IACjCA,EAAaC,iB","file":"static/js/main.958c1164.chunk.js","sourcesContent":["import React, { Component } from \"react\"\n\nclass Header extends Component {\n render() {\n return (\n
\n

SOLAR BEATS

\n

Built using React.js, Netlify, and FaunaDB — designed to make it easier to view liked tracks on SoundCloud

\n
\n );\n }\n}\n\nexport default Header","import React, { Component } from \"react\";\n\nclass Footer extends Component {\n render() {\n return (\n
\n While it is always best to believe in oneself, a little help from others can be a great blessing - Uncle Iroh\n
\n );\n }\n}\n\nexport default Footer","import React, { Component } from \"react\"\n\nclass LikedTrack extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: this.props.listOfTracks\n }\n }\n render() {\n return (\n
\n \"\"/ \n

{this.state.data[0]} · {this.state.data[1]}

\n
\n );\n }\n}\n\nexport default LikedTrack","import React, { Component } from \"react\"\nimport Header from './components/header';\nimport Footer from './components/footer';\nimport LikedTrack from './components/likedTrack';\nimport \"./App.css\"\nimport fetch from \"node-fetch\"\n\nclass App extends Component {\n state = {\n tracks: [],\n handleClickBool: false\n }\n\n async handleClick() {\n\n /**\n * it seems like we want to fetch the data on handleClick, butttttt\n * we can't render onClick, so we need to store the data, and then render seperately..?\n * \n */\n\n let tracks = await fetch('/.netlify/functions/db-get-liked-tracks')\n .then(response => response.json())\n .then((user) => {\n // console.log(user.tracks)\n return user.tracks\n })\n // console.log(tracks)\n\n // so react can't store objects in setState keys, lets try to extract our track objects to be lists perhaps?\n\n let trackInfo = []\n let trackList = []\n\n tracks.forEach((t) => {\n trackInfo.push(t.track_name)\n trackInfo.push(t.track_artist)\n trackInfo.push(t.track_img)\n trackInfo.push(t.track_url)\n trackList.push(trackInfo)\n trackInfo = []\n })\n\n // console.log(trackList)\n\n this.setState({\n tracks: trackList,\n handleClickBool: true\n })\n }\n\n render() {\n return (\n <>\n
\n
\n
\n

This site is a work in progress, and its only intended purpose is for testing

\n

Currently, it only retrieves liked tracks of a specific backend-designated user

\n

Click the button to see all of SHAY LEON's liked tracks

\n \n \n
\n {\n this.state.handleClickBool \n ? this.state.tracks.map((track) => )\n : console.log(this.state.handleClickBool)\n }\n
\n \n
\n
\n \n )\n }\n}\n\nexport default App\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 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);\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://goo.gl/SC7cgQ'\n );\n });\n } else {\n // Is not local host. 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 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\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 .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, 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.then(registration => {\n registration.unregister();\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(, document.getElementById('root'));\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: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}