\r\n );\r\n }\r\n \r\n showSidebar = () => this.setState({ visible: true });\r\n \r\n handleSidebarHide = () => this.setState({ visible: false });\r\n}\r\n","import React, { Component } from 'react';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { Link } from 'react-router-dom';\r\nimport { Menu, Icon, LabelProps } from 'semantic-ui-react';\r\nimport userManager from '../userManager';\r\nimport MenuUser from './MenuUser';\r\nimport { ApplicationState } from '../..';\r\nimport * as Core from '../../core';\r\n\r\nconst connector = connect(\r\n (state: ApplicationState) => ({\r\n logo: state.core.auth.user?.profile.picture,\r\n }),\r\n Core.actions,\r\n)\r\ntype PropsFromRedux = ConnectedProps\r\n\r\ntype PrincipaleHeaderDefaultProps = PropsFromRedux\r\n\r\nclass PrincipaleHeaderDefault extends Component {\r\n constructor(props: PrincipaleHeaderDefaultProps) {\r\n super(props);\r\n \r\n this.onLogout = this.onLogout.bind(this);\r\n this.onLinguaClick = this.onLinguaClick.bind(this);\r\n }\r\n\r\n render () {\r\n const { logo } = this.props;\r\n\r\n return (\r\n \r\n );\r\n } \r\n\r\n onLogout() {\r\n userManager.signoutRedirect();\r\n }\r\n\r\n onLinguaClick(_: React.MouseEvent, data: LabelProps) {\r\n this.props.cambiaLingua(data.lingua);\r\n }\r\n}\r\n\r\nexport default connector(PrincipaleHeaderDefault);\r\n","import React, { RefObject } from \"react\";\r\nimport { Container, Divider, Sticky, Ref } from \"semantic-ui-react\";\r\nimport HeaderDefault from \"./HeaderDefault\";\r\nimport Routes from \"./Routes\";\r\n\r\nexport default class Principale extends React.Component {\r\n private contextRef: RefObject;\r\n\r\n constructor(props: {}) {\r\n super(props);\r\n\r\n this.contextRef = React.createRef();\r\n }\r\n\r\n render() {\r\n // il div è utilizzato perche il container fluid, in versione mobile, lascia dello spazio a destra e sinistra nel menu\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","import React, { createRef } from \"react\";\r\nimport PrincipaleMobile from './PrincipaleMobile';\r\nimport PrincipaleDefault from './PrincipaleDefault';\r\nimport { mediaStyles, MediaContextProvider, Media } from \"../../core\";\r\n\r\nexport default class Principale extends React.Component {\r\n contextRef = createRef();\r\n\r\n render() {\r\n // il div è utilizzato perche il container fluid, in versione mobile, lascia dello spazio a destra e sinistra nel menu\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","import React from 'react';\r\nimport { Route, Switch } from 'react-router-dom';\r\nimport PrivateRoute from './PrivateRoute';\r\nimport GoToLogin from './GoToLogin';\r\nimport SignoutCallback from './SignoutCallback';\r\nimport SigninCallback from './SigninCallback';\r\nimport AjaxLoader from './AjaxLoader';\r\nimport Principale from './Principale';\r\n\r\nexport default () => (\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n);","// In production, we register a service worker to serve assets from local cache.\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 the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\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.1/8 is 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 default function register() {\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);\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/facebookincubator/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. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\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 }\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) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n if (\r\n response.status === 404 ||\r\n response.headers.get('content-type').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);\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.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import { ApplicationInsights, ITelemetryItem } from '@microsoft/applicationinsights-web';\r\nimport { ReactPlugin } from '@microsoft/applicationinsights-react-js';\r\n\r\n/**\r\n * Create the App Insights Telemetry Service\r\n * @return {{reactPlugin: ReactPlugin, appInsights: Object, initialize: Function}} - Object\r\n */\r\nconst createTelemetryService = () => {\r\n let reactPlugin = null;\r\n let appInsights = null;\r\n\r\n /**\r\n * Initialize the Application Insights class\r\n * @param {string} instrumentationKey - Application Insights Instrumentation Key\r\n * @param {Object} browserHistory - client's browser history, supplied by the withRouter HOC\r\n * @return {void}\r\n */\r\n const initialize = (instrumentationKey: string, browserHistory: Object) => {\r\n if (!instrumentationKey || !browserHistory) {\r\n throw new Error('Could not initialize Telemetry Service');\r\n }\r\n\r\n reactPlugin = new ReactPlugin();\r\n\r\n appInsights = new ApplicationInsights({\r\n config: {\r\n instrumentationKey: instrumentationKey,\r\n maxBatchInterval: 0,\r\n enableAutoRouteTracking: true,\r\n enableCorsCorrelation: true,\r\n disableFetchTracking: false,\r\n disableCorrelationHeaders: false,\r\n isCookieUseDisabled: true, // disabilita i cookie per tracciare gli utenti\r\n extensions: [reactPlugin],\r\n extensionConfig: {\r\n [reactPlugin.identifier]: {\r\n history: browserHistory\r\n }\r\n }\r\n }\r\n });\r\n\r\n appInsights.loadAppInsights();\r\n \r\n appInsights.addTelemetryInitializer((envelope: ITelemetryItem) => {\r\n if (envelope.tags !== undefined) {\r\n envelope.tags[\"ai.cloud.role\"] = \"contributo-impresa-spa\";\r\n }\r\n });\r\n };\r\n\r\n return { reactPlugin, appInsights, initialize };\r\n};\r\n\r\nexport const ai = createTelemetryService();","import React, { Fragment } from 'react';\r\nimport { withAITracking } from '@microsoft/applicationinsights-react-js';\r\nimport { ai } from './TelemetryService';\r\nimport { withRouter } from 'react-router-dom';\r\n\r\n/**\r\n * This Component provides telemetry with Azure App Insights\r\n *\r\n * NOTE: the package '@microsoft/applicationinsights-react-js' has a HOC withAITracking that requires this to be a Class Component rather than a Functional Component\r\n */\r\nclass TelemetryProvider extends React.Component {\r\n state = {\r\n initialized: false\r\n };\r\n\r\n componentDidMount() {\r\n const { history } = this.props;\r\n const { initialized } = this.state;\r\n const AppInsightsInstrumentationKey = process.env.REACT_APP_AI_INSTRUMENTATION_KEY; // PUT YOUR KEY HERE\r\n if (!Boolean(initialized) && Boolean(AppInsightsInstrumentationKey) && Boolean(history)) {\r\n ai.initialize(AppInsightsInstrumentationKey, history);\r\n this.setState({ initialized: true });\r\n }\r\n }\r\n\r\n render() {\r\n const {children} = this.props;\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withRouter(withAITracking(ai.reactPlugin, TelemetryProvider));","import 'semantic-ui-css/semantic.min.css'\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\nimport { ConnectedRouter } from 'connected-react-router';\r\nimport { createBrowserHistory } from 'history';\r\nimport configureStore from './store/configureStore';\r\nimport { App } from './modules/main';\r\nimport registerServiceWorker from './registerServiceWorker';\r\nimport TelemetryProvider from './telemetry/TelemetryProvider';\r\n\r\n// Create browser history to use in the Redux store\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href') as string;\r\nconst history = createBrowserHistory({ basename: baseUrl });\r\n\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\nconst store = configureStore(history);\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\nregisterServiceWorker();\r\n","import { applyMiddleware, combineReducers, compose, createStore } from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\nimport { ApplicationState, reducers } from '../modules';\r\n\r\nexport default function configureStore(history: History, initialState?: ApplicationState) {\r\n const middleware = [\r\n thunk,\r\n routerMiddleware(history)\r\n ];\r\n\r\n const rootReducer = combineReducers({\r\n ...reducers,\r\n router: connectRouter(history)\r\n });\r\n\r\n const enhancers = [];\r\n const windowIfDefined = typeof window === 'undefined' ? null : window as any;\r\n if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\r\n enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\r\n }\r\n\r\n return createStore(\r\n rootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middleware), ...enhancers)\r\n );\r\n}"],"sourceRoot":""}