{"version":3,"sources":["js/Services/Helpers/languages.js","js/Components/Header/Header.js","js/Elements/SpyMenu.js","js/Elements/MenuCategory.js","js/Components/Main/MenuCard.js","js/Components/Footer/Footer.js","js/Services/API/httpServices.js","js/Services/API/menuAPI.js","js/Components/Main/Menu.js","i18n.js","js/App.js","serviceWorker.js","index.js"],"names":["languages","Header","_ref","handleLanguageChange","restaurant","lang","options","map","language","react_default","a","createElement","defaultValue","value","key","toUpperCase","className","name","onChange","e","SpyMenu","_this","this","props","categories","items","item","push","react","Navbar","bg","variant","expand","i","itemName","JSON","parse","href","Component","formatter","Intl","NumberFormat","style","currency","MenuCategory","categorie","t","useTranslation","Card","Body","Title","id","menuItems","menuItem","menuItemName","menuItemDescription","description","dangerouslySetInnerHTML","__html","replace","allergens","length","fontSize","allergy","allergyname","format","price","MenuCard","width","cat","Elements_MenuCategory","Footer","url","concat","stardekkUrl","target","rel","xmlns","viewBox","d","fill","axios","interceptors","response","use","error","status","console","log","toast","Promise","reject","httpServices","get","post","put","delete","getMenu","menuId","http","config","apiEndpoint","getDefaultForSlug","slug","Menu","state","menu","setState","match","params","data","react_toastify_esm","Elements_SpyMenu","menuCategories","Container","fluid","Row","Col","Main_MenuCard","withRouter","resources","en","translation","nl","fr","de","ir","es","i18n","detector","initReactI18next","init","fallbackLng","keySeparator","interpolation","escapeValue","_useTranslation","changeLanguage","react_router_dom","react_router","path","strict","Main_Menu","exact","Boolean","window","location","hostname","store","createStore","composeWithDevTools","applyMiddleware","thunk","ReactDOM","render","fallback","js_App","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","message"],"mappings":"mRAEeA,EAFG,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MCKlC,SAASC,EAATC,GAA0D,IAAzCC,EAAyCD,EAAzCC,qBAA4BC,GAAaF,EAAnBG,KAAmBH,EAAbE,YACpDE,EAAUN,EAAUO,IAAI,SAAAC,GACxB,OAAOC,EAAAC,EAAAC,cAAA,UAAQC,aAAcJ,EAAUK,M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cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASvC,MACvB,2DCNN,IAAMwC,EAAQC,sBACZC,8BACIC,0BAAgBC,OAGtBC,IAASC,OACPjJ,EAAAC,EAAAC,cAACiB,EAAA,SAAD,CAAU+H,SAAWlJ,EAAAC,EAAAC,cAAA,aACrBF,EAAAC,EAAAC,cAACoH,EAAA,EAAD,CAAUqB,MAAOA,GACf3I,EAAAC,EAAAC,cAAC+H,EAAA,EAAD,KACEjI,EAAAC,EAAAC,cAACiJ,EAAD,SAIJC,SAASC,eAAe,SD0GpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,KAAK,SAAAC,GACJA,EAAaC,eAEdC,MAAM,SAAAhF,GACLE,QAAQF,MAAMA,EAAMiF","file":"static/js/main.c7bd9195.chunk.js","sourcesContent":["const languages = ['nl', 'fr', 'en', 'de', 'it', 'es'];\r\n\r\nexport default languages;","import React from 'react';\r\nimport languages from '../../Services/Helpers/languages';\r\n\r\n\r\n\r\nexport default function Header({handleLanguageChange, lang, restaurant}) {\r\n let options = languages.map(language => {\r\n return \r\n });\r\n\r\n return (\r\n
\r\n
\r\n
\r\n {(restaurant) &&

{restaurant.name}

}\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n )\r\n}","import React, {Component, Fragment} from \"react\";\r\nimport { Navbar} from \"react-bootstrap\";\r\n\r\nclass SpyMenu extends Component {\r\n render(){\r\n if(!this.props.categories){\r\n return
loading...
\r\n }\r\n\r\n let items = [];\r\n this.props.categories.map(item => items.push(item.name))\r\n return (\r\n \r\n
\r\n \r\n
\r\n {\r\n items.map((item, i) => {\r\n let itemName = JSON.parse(item)[this.props.lang.toUpperCase()];\r\n return
{itemName}
\r\n\r\n })\r\n }\r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n}\r\n\r\nexport default SpyMenu;\r\n\r\n","import React from 'react';\r\nimport {Card, ListGroup} from 'react-bootstrap';\r\nimport {useTranslation} from 'react-i18next';\r\n\r\n// Number formatter.\r\nvar formatter = new Intl.NumberFormat('nl-BE', {\r\n style: 'currency',\r\n currency: 'EUR',\r\n });\r\n \r\n\r\nfunction MenuCategory({categorie, lang}) {\r\n\r\n let name = JSON.parse(categorie.name);\r\n let {t} = useTranslation();\r\n\r\n return (\r\n \r\n \r\n {name[lang]}\r\n
\r\n
\r\n {\r\n categorie.menuItems.map((menuItem, i) => {\r\n let menuItemName = JSON.parse(menuItem.name)\r\n let menuItemDescription = JSON.parse(menuItem.description)\r\n return
\r\n
\r\n
{menuItemName[lang]}
\r\n {\r\n (menuItemDescription[lang] !== null ) &&
')}}>
\r\n }\r\n {\r\n (menuItem.allergens.length > 0) &&\r\n
\r\n {t(\"Allergens\")}: \r\n {\r\n menuItem.allergens.map((allergy, i) => {\r\n let allergyname = JSON.parse(allergy.name)\r\n return {allergyname[lang]}\r\n })\r\n }\r\n
\r\n }\r\n
\r\n
{formatter.format(menuItem.price)}
\r\n
\r\n })\r\n }
\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default MenuCategory;\r\n","import React, {Component} from 'react';\r\nimport { Card} from 'react-bootstrap';\r\nimport MenuCategory from '../../Elements/MenuCategory';\r\n\r\n\r\nclass MenuCard extends Component { \r\n \r\n render(){ \r\n if (!this.props.categories) {\r\n return
loading
\r\n }\r\n\r\n let name = JSON.parse(this.props.name);\r\n let lang = this.props.lang.toUpperCase();\r\n \r\n return (\r\n
\r\n \r\n \r\n {name[lang]}\r\n \r\n { \r\n this.props.categories.map((cat, i) =>{\r\n return (\r\n \r\n )\r\n })}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default MenuCard;","import React from 'react';\r\nimport {useTranslation} from 'react-i18next';\r\n\r\nexport default function Footer({lang}) {\r\n\r\n const url = `https://www.younight.com/${lang}`;\r\n const stardekkUrl = `https://www.stardekk.com/${lang}`;\r\n let {t} = useTranslation();\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import axios from 'axios';\r\nimport {toast} from 'react-toastify';\r\n\r\naxios.interceptors.response.use(null, error => {\r\n const expectedError = error.response && error.response.status >= 400 && error.response.status < 500;\r\n \r\n if(!expectedError){\r\n console.log(\"Logging error: \",error);\r\n toast.error(\"An unexpected error accurred.\");\r\n }\r\n \r\n return Promise.reject(error)\r\n });\r\n \r\n export default {\r\n get: axios.get,\r\n post: axios.post,\r\n put: axios.put,\r\n delete: axios.delete\r\n };","import http from '../API/httpServices'\r\nimport config from '../API/config.json'\r\n\r\n\r\nexport default function getMenu(menuId) {\r\n return http.get(`${config.apiEndpoint}menus/${menuId}`);\r\n}\r\n\r\n\r\nexport function getDefaultForSlug(slug) {\r\n return http.get(`${config.apiEndpoint}restaurant/${slug}/defaultmenu`);\r\n}\r\n \r\n\r\nexport function passLanguage(language) {\r\n return http.post(`${config.apiEndpoint}/${language}`)\r\n}","import React, {Component} from 'react';\r\nimport Header from '../Header/Header'\r\nimport SpyMenu from '../../Elements/SpyMenu'\r\nimport MenuCard from '../Main/MenuCard';\r\nimport Footer from '../Footer/Footer';\r\nimport {ToastContainer} from 'react-toastify'\r\nimport getMenu, {getDefaultForSlug} from '../../Services/API/menuAPI';\r\nimport {Container, Row, Col} from 'react-bootstrap';\r\nimport { withRouter } from \"react-router\";\r\n\r\nclass Menu extends Component { \r\n state ={\r\n menu: {},\r\n lang: \"nl\",\r\n };\r\n\r\n handleLanguageChange = (e) =>{\r\n let lang = e.target.value\r\n this.setState({lang});\r\n this.props.handleLanguageChange(lang);\r\n }\r\n \r\n async componentDidMount() {\r\n const menuId = this.props.match.params.menuId;\r\n const slug = this.props.match.params.slug;\r\n const {data} = (menuId == null?await getDefaultForSlug(slug):await getMenu(menuId));\r\n const menu = {...data};\r\n this.setState({menu});\r\n }\r\n\r\n render(){\r\n return( \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n )\r\n } \r\n\r\n }\r\n\r\nexport default withRouter(Menu);","import i18n from \"i18next\";\r\nimport { initReactI18next } from \"react-i18next\";\r\nimport detector from \"i18next-browser-languagedetector\";\r\nimport translationEN from './Locales/en/translation.json';\r\nimport translationNL from './Locales/nl/translation.json';\r\nimport translationFR from './Locales/fr/translation.json';\r\nimport translationDE from './Locales/de/translation.json';\r\nimport translationIT from './Locales/it/translation.json';\r\nimport translationES from './Locales/es/translation.json';\r\n\r\n// the translations\r\nconst resources = {\r\n en: {\r\n translation: translationEN\r\n },\r\n nl: {\r\n translation: translationNL\r\n },\r\n fr: {\r\n translation: translationFR\r\n },\r\n de: {\r\n translation: translationDE\r\n },\r\n ir: {\r\n translation: translationIT\r\n },\r\n es: {\r\n translation: translationES\r\n }\r\n};\r\n\r\ni18n\r\n .use(detector)\r\n .use(initReactI18next) // passes i18n down to react-i18next\r\n .init({\r\n resources,\r\n fallbackLng: \"en\",\r\n keySeparator: false, // we do not use keys in form messages.welcome\r\n\r\n interpolation: {\r\n escapeValue: false // react already safes from xss\r\n }\r\n });\r\n\r\nexport default i18n;","import React from 'react';\r\nimport 'react-toastify/dist/ReactToastify.css'\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\r\nimport { withRouter } from \"react-router\";\r\nimport Menu from '../js/Components/Main/Menu';\r\n\r\nimport '../i18n';\r\n\r\n\r\nfunction App() { \r\n const { t, i18n } = useTranslation();\r\n\r\n function handleLanguageChange(e){\r\n i18n.changeLanguage(e);\r\n }\r\n\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{t(\"Error\")}
\r\n
\r\n \r\n \r\n
\r\n );\r\n \r\n}\r\n\r\nexport default withRouter(App);\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { Suspense } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux'\r\nimport { createStore, applyMiddleware } from 'redux';\r\nimport { composeWithDevTools } from 'redux-devtools-extension';\r\nimport thunk from 'redux-thunk';\r\nimport { BrowserRouter as Router } from \"react-router-dom\";\r\n\r\nimport 'bootstrap/dist/css/bootstrap.min.css';\r\nimport './scss/index.scss';\r\nimport App from './js/App';\r\nimport * as serviceWorker from './serviceWorker';\r\nconst store = createStore(\r\n composeWithDevTools(\r\n applyMiddleware(thunk)\r\n )\r\n);\r\nReactDOM.render(\r\n )}>\r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}