{"version":3,"sources":["index.js","serviceWorker.js","services/AADService.js","core/UserInfo.js","components/PagePowerBI.jsx","routes.js","indexApp.js","core/constants.js","adalConfig.js"],"names":["runWithAdal","authContext","require","Boolean","window","location","hostname","match","AADService","login","this","getUser","logOut","getCachedToken","endpoint","getCachedUser","decode","getToken","claims","getClaims","hasOwnProperty","roles","role","getRoles","i","length","UserInfo","aad","profile","name","upn","id","tid","PagePowerBI","commom","React","srcImg","setSrc","titlePage","setTitlePage","useEffect","switchRender","getData","tenantID","a","$","get","tenantId","done","data","wait","userInfo","Tenant","getIframe","Helmet","className","fluid","style","width","height","src","title","Routes","exact","path","Component","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","REDIRECT","TENANT","CLIENT_ID","CLIENT_SECRET","dotenv","config","process","adalConfig","tenant","Constants","clientId","redirectUri","endpoints","api","cacheLocation","AuthenticationContext","withAdalLogin"],"mappings":"iKAAA,0BAKAA,sBAAYC,KAAa,WAGvBC,EAAQ,OALW,I,iGCSDC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,kGCfeC,E,qFAEjB,WACIP,IAAYQ,U,sBAGhB,WACI,OAAOC,KAAKC,Y,oBAGhB,WACIV,IAAYW,W,sBAGhB,WACI,OAAOX,IAAYY,eAAeC,O,qBAGtC,WAEI,OADQb,IAAYc,kB,uBAIxB,WACI,OAAOC,YAAON,KAAKO,c,sBAGvB,WACI,IAAMC,EAASR,KAAKS,YAEpB,OAAID,EAAOE,eAAe,SACfF,EAAOG,MAGX,O,sBAGX,SAASC,GACL,GAAIZ,KAAKa,WACL,IAAK,IAAIC,EAAI,EAAGA,EAAId,KAAKa,WAAWE,OAAQD,IACxC,GAAId,KAAKa,WAAWC,KAAOF,EACvB,OAAO,EAGnB,OAAO,M,KC3BAI,E,WAjBX,aAAc,oBACVhB,KAAKiB,IAAM,IAAInB,E,0CAEnB,WACI,OAAOE,KA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SAAW,sCAaA,EANK,CAChBC,OAAQ,SACRC,UAAW,uCACXC,cAAe,yCCzBnB,oEAIAC,IAAOC,SAEA,IAAMnE,EAAUoE,uCAEVC,EAAa,CACxBC,OAAQC,EAAeR,OACvBS,SAAUD,EAAeP,UACzBS,YAAaF,EAAeT,SAC5BY,UAAW,CACTC,IAAK,sCAEPC,cAAe,kBAGJzF,EAAc,IAAI0F,wBAAsBR,GAKrBS,wBAAc3F,EAAakF,EAAWK,UAAUC,O","file":"static/js/main.e894fc8c.chunk.js","sourcesContent":["import { runWithAdal } from 'react-adal';\nimport { authContext } from './adalConfig';\n \nconst DO_NOT_LOGIN = false;\n \nrunWithAdal(authContext, () => {\n \n // eslint-disable-next-line\n require('./indexApp.js');\n \n},DO_NOT_LOGIN);","// 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 {authContext, endpoint} from '../adalConfig';\nimport decode from 'jwt-decode';\n\nexport default class AADService {\n\n login() {\n authContext.login();\n }\n\n loggedIn() {\n return this.getUser();\n }\n\n logout() {\n authContext.logOut();\n }\n\n getToken() {\n return authContext.getCachedToken(endpoint);\n }\n\n getUser() {\n var a = authContext.getCachedUser()\n return a ;\n }\n\n getClaims() {\n return decode(this.getToken());\n }\n\n getRoles() {\n const claims = this.getClaims();\n\n if (claims.hasOwnProperty('roles')) {\n return claims.roles;\n }\n\n return null;\n }\n\n isInRole(role) {\n if (this.getRoles()) {\n for (let i = 0; i < this.getRoles().length; i++) {\n if (this.getRoles()[i] === role)\n return true;\n }\n }\n return false;\n }\n}","import AADService from \"../services/AADService\";\n\nclass UserInfo {\n constructor(){\n this.aad = new AADService();\n }\n get Username() {\n return this.aad.getUser().profile.name;\n }\n get Email() {\n return this.aad.getUser().profile.upn;\n }\n get Id() {\n return this.aad.getUser().profile.id;\n }\n get Tenant() {\n return this.aad.getUser().profile.tid;\n }\n}\n\nexport default UserInfo;","import * as React from \"react\";\nimport { useEffect } from \"react\";\nimport UserInfo from \"../core/UserInfo\";\nimport { Helmet } from 'react-helmet'\nimport $ from \"jquery\";\n\nconst PagePowerBI = (commom) => {\n const [srcImg, setSrc] = React.useState();\n const [titlePage, setTitlePage] = React.useState(\"Relatórios Analíticos\");\n\n useEffect(() => {\n switchRender();\n }, []);\n\n const getData = async (tenantID) => {\n var url = \"https://provisionadorteams.bigbrain.com.br/api/primeiroacesso/getClientAnalytics/\";\n var wait = await $.get(url, { tenantId: tenantID })\n .done(function (data) {\n return data\n });\n return wait\n };\n\n const switchRender = async () => {\n debugger\n let userInfo = new UserInfo();\n var getIframe = await getData(userInfo.Tenant);\n \n if (getIframe !== false) {\n setSrc(getIframe);\n setTitlePage(\"Relatórios Analíticos\")\n }\n };\n\n return (\n <>\n \n {titlePage}\n \n
\n \n \n \n
\n \n );\n};\n\nexport default PagePowerBI;\n","import React, { Component } from \"react\";\nimport { Route, BrowserRouter, Switch } from \"react-router-dom\";\n\nimport PagePowerBI from \"./components/PagePowerBI\";\n\nclass Routes extends Component {\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default Routes;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as serviceWorker from './serviceWorker';\nimport Routes from './routes';\nimport './App.css';\n\n//ReactDOM.render(, document.getElementById('root'));\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: https://bit.ly/CRA-PWA\nserviceWorker.unregister();","// GLOBAL CONSTANTS\n// -----------------------------------\n\nexport const STORAGE_KEYS = {\n JWT_KEY: 'learningPlan.jwt',\n JWT_REF_KEY: 'learningPlan.ref_jwt',\n JWT_EXP_KEY: 'learningPlan.exp_jwt',\n USER_NAME: 'learningPlan.full_user_name',\n USER_EMAIL: 'learningPlan.full_user_email'\n};\n\n//LOCAL\nexport const URLS = {\n \n // PROD\n REDIRECT : \"https://analytics.bigbrain.com.br/\",\n\n \n //LOCALHOST\n //REDIRECT : \"http://localhost:44325/\",\n}\n\nexport const ADAL = {\n TENANT: \"common\",\n CLIENT_ID: \"2a61922d-1ba7-4dc4-9a29-1bee8d5b7cb6\",\n CLIENT_SECRET: \"f917Q~nh8rLE0hM_VhXL7f0UXG0X0T~FocKU8\"\n}\n\nexport default {\n STORAGE_KEYS,\n URLS,\n ADAL\n}\n","import { AuthenticationContext, adalFetch, withAdalLogin } from 'react-adal';\nimport dotenv from 'dotenv';\nimport {Constants} from './core';\n\ndotenv.config();\n\nexport const endpoint =process.env.REACT_APP_CLIENT_ID;\n\nexport const adalConfig = {\n tenant: Constants.ADAL.TENANT,\n clientId: Constants.ADAL.CLIENT_ID,\n redirectUri: Constants.URLS.REDIRECT,\n endpoints: {\n api: 'https://login.microsoftonline.com/',\n },\n cacheLocation: 'sessionStorage'\n};\n \nexport const authContext = new AuthenticationContext(adalConfig);\n \nexport const adalApiFetch = (fetch, url, options) =>\n adalFetch(authContext, adalConfig.endpoints.api, fetch, url, options);\n \nexport const withAdalLoginApi = withAdalLogin(authContext, adalConfig.endpoints.api);"],"sourceRoot":""}