{"version":3,"sources":["CalendarioMINTC.js","serviceWorker.js","index.js"],"names":["CalendarioMINTC","state","isLoading","data","error","feed","this","setState","fetch","then","response","json","catch","fetchData","props","Date","getTime","citta","medici","id","className","map","medico","index","key","href","urlPaginaMedico","titolo","nome","cognome","style","textAlign","url","specializzazione","calendario","Object","keys","mese","join","React","PureComponent","Boolean","window","location","hostname","match","document","getElementById","calendarioMINTC","ReactDOM","render","dataset","navigator","serviceWorker","ready","registration","unregister"],"mappings":"wUA4FeA,G,kNAxFXC,MAAQ,CACJC,WAAW,EACXC,KAAM,KACNC,MAAO,M,yEAGDC,GAAO,IAAD,OACZC,KAAKC,SAAS,CAAEL,WAAW,IAE3BM,MAAMH,GAEDI,MAAK,SAAAC,GAAQ,OAAIA,EAASC,UAE1BF,MAAK,SAAAN,GAAI,OACN,EAAKI,SAAS,CACVJ,KAAMA,EACND,WAAW,OAIlBU,OAAM,SAAAR,GAAK,OAAI,EAAKG,SAAS,CAAEH,QAAOF,WAAW,S,0CAItDI,KAAKO,UAAUP,KAAKQ,MAAMT,KAAO,OAAQ,IAAIU,MAAOC,a,+BAKpD,IAAIV,KAAKL,MAAME,KACX,OAAO,KAHN,MAMmBG,KAAKL,MAAME,KAA5Bc,EANF,EAMEA,MAAOC,EANT,EAMSA,OAEd,OACI,yBAAKC,GAAG,oBAEJ,uBAAGC,UAAU,gDAAb,sDAAgHH,GAEhH,yBAAKG,UAAU,0BACX,uBAAGA,UAAU,kCAAb,6EAGJ,yBAAKA,UAAU,4BAGPF,EAAOG,KAAI,SAACC,EAAQC,GAAT,OAEP,yBAAKH,UAAU,eAAeI,IAAKD,GAE/B,yBAAKH,UAAU,4BACX,yBAAKA,UAAU,oEACX,6BACI,gCAAQ,uBAAGK,KAAMH,EAAOI,iBAAkBJ,EAAOK,OAAzC,IAAkDL,EAAOM,KAAzD,IAAgEN,EAAOO,WAEnF,yBAAKC,MAAO,CAACC,UAAW,UACpB,uBAAGX,UAAU,wBAAwBK,KAAMH,EAAOU,KAAlD,oBAGR,yBAAKZ,UAAU,oEAAoEE,EAAOW,kBAItFX,EAAOY,WAAaC,OAAOC,KAAKd,EAAOY,YAAYb,KAAI,SAACgB,EAAMd,GAAP,OACnD,yBAAKC,IAAKD,GACN,yBAAKH,UAAU,iDAAiDiB,GAChE,yBAAKjB,UAAU,gDAAgDE,EAAOY,WAAWG,GAAMC,KAAK,YAEhG,yBAAKlB,UAAU,uDAAf,qC,GAtEdmB,IAAMC,gBCShBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCTOC,SAASC,eAAe,QAArC,IACMC,EAAkBF,SAASC,eAAe,mBAM7CC,GACCC,IAASC,OAAO,kBAAC,EAAqBF,EAAgBG,SAAcH,GDgHlE,kBAAmBI,WACrBA,UAAUC,cAAcC,MAAM7C,MAAK,SAAA8C,GACjCA,EAAaC,kB","file":"static/js/main.140701ad.chunk.js","sourcesContent":["import React from 'react';\r\nimport './CalendarioMINTC.css';\r\n\r\nclass CalendarioMINTC extends React.PureComponent {\r\n state = {\r\n isLoading: false,\r\n data: null,\r\n error: null\r\n }\r\n\r\n fetchData(feed) {\r\n this.setState({ isLoading: true })\r\n\r\n fetch(feed)\r\n \r\n .then(response => response.json())\r\n\r\n .then(data => \r\n this.setState({\r\n data: data,\r\n isLoading: false,\r\n })\r\n )\r\n\r\n .catch(error => this.setState({ error, isLoading: false }));\r\n }\r\n\r\n componentDidMount() {\r\n this.fetchData(this.props.feed + '?v=' + new Date().getTime()); \r\n }\r\n\r\n render() {\r\n\r\n if(!this.state.data) {\r\n return null;\r\n }\r\n\r\n const {citta, medici} = this.state.data;\r\n\r\n return (\r\n
\r\n \r\n

Consulta il calendario e prenota un appuntamento a {citta}

\r\n \r\n
\r\n

Seleziona il medico e la sede di tuo interesse e prenota un appuntamento

\r\n
\r\n\r\n
\r\n\r\n {\r\n medici.map((medico, index) => \r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n Prenota adesso\r\n
\r\n
\r\n
{medico.specializzazione}
\r\n\r\n {\r\n\r\n medico.calendario ? Object.keys(medico.calendario).map((mese, index) => \r\n
\r\n
{mese}
\r\n
{medico.calendario[mese].join(' - ')}
\r\n
\r\n ) :
Calendario da definire
\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\n\r\nexport default CalendarioMINTC;\r\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.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.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 .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.then(registration => {\n registration.unregister();\n });\n }\n}\n","import 'react-app-polyfill/ie11';\nimport 'react-app-polyfill/stable';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\n// import App from './App';\nimport CalendarioMINTC from './CalendarioMINTC';\nimport * as serviceWorker from './serviceWorker';\n\nconst root = document.getElementById('root');\nconst calendarioMINTC = document.getElementById('calendarioMINTC');\n\n// if(root) {\n// ReactDOM.render(, root);\n// }\n\nif(calendarioMINTC) {\n ReactDOM.render(, calendarioMINTC);\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":""}