{"version":3,"sources":["App.js","registerServiceWorker.js","index.js"],"names":["App","manager","this","props","React","Component","isLocalhost","Boolean","window","location","hostname","match","registerValidSW","swUrl","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","state","controller","console","log","catch","error","mountNode","document","getElementById","onload","predefinedConfig","appConfig","configuration","Flex","provideLoginInfo","create","ReactDOM","render","renderApp","handleError","defaultProps","logoUrl","URL","process","origin","addEventListener","fetch","response","status","headers","get","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"mZAmBeA,E,4JAfb,WACE,IAAQC,EAAYC,KAAKC,MAAjBF,QAER,OAAKA,EAKH,kBAAC,kBAAD,CAAsBA,QAASA,GAC7B,kBAAC,gBAAD,OALK,S,GALKG,IAAMC,WCOlBC,EAAcC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DAsCN,SAASC,EAAgBC,GACvBC,UAAUC,cACPC,SAASH,GACTI,MAAK,SAAAC,GACJA,EAAaC,cAAgB,WAC3B,IAAMC,EAAmBF,EAAaG,WACtCD,EAAiBE,cAAgB,WACA,cAA3BF,EAAiBG,QACfT,UAAUC,cAAcS,WAK1BC,QAAQC,IAAI,6CAKZD,QAAQC,IAAI,4CAMrBC,OAAM,SAAAC,GACLH,QAAQG,MAAM,4CAA6CA,MCvEjE,IAAMC,EAAYC,SAASC,eAAe,QAE1CvB,OAAOwB,OAAS,WACd,IAAMC,EAAmBzB,OAAO0B,WAAa,GAEvCC,EAAa,eACdF,GAGLG,WACYP,GACTQ,iBAAiBF,EAAeN,GAChCZ,MAAK,kBAAMmB,UAAaE,OAAOH,MAC/BlB,MAAK,SAAAhB,GAAO,OAMjB,SAAmBA,GACjBsC,IAASC,OACP,kBAAC,EAAD,CAAKvC,QAASA,IACd4B,GATiBY,CAAUxC,MAC1B0B,OAAM,SAAAC,GAAK,OAYhB,SAAqBA,GACnBQ,YAAeR,EAAOC,GACtBJ,QAAQG,MAAM,4BAA6BA,GAdzBc,CAAYd,OAEhCQ,aAAgBO,aAAaC,QAAU,wBDJxB,WACb,GAA6C,kBAAmB9B,UAAW,CAGzE,GADkB,IAAI+B,IAAIC,GAAwBtC,OAAOC,UAC3CsC,SAAWvC,OAAOC,SAASsC,OAIvC,OAGFvC,OAAOwC,iBAAiB,QAAQ,WAC9B,IAAMnC,EAAK,UAAMiC,GAAN,6BAEPxC,IAiDV,SAAiCO,GAE/BoC,MAAMpC,GACHI,MAAK,SAAAiC,GAGkB,MAApBA,EAASC,SACuD,IAAhED,EAASE,QAAQC,IAAI,gBAAgBC,QAAQ,cAG7CxC,UAAUC,cAAcwC,MAAMtC,MAAK,SAAAC,GACjCA,EAAasC,aAAavC,MAAK,WAC7BT,OAAOC,SAASgD,eAKpB7C,EAAgBC,MAGnBc,OAAM,WACLF,QAAQC,IACN,oEArEAgC,CAAwB7C,GAIxBC,UAAUC,cAAcwC,MAAMtC,MAAK,WACjCQ,QAAQC,IACN,gHAMJd,EAAgBC,OCTxB8C,I","file":"static/js/main.18f2765d.chunk.js","sourcesContent":["import React from \"react\";\r\nimport * as Flex from \"@twilio/flex-ui\";\r\n\r\nclass App extends React.Component {\r\n render() {\r\n const { manager } = this.props;\r\n\r\n if (!manager) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default App;\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}/assets/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);\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://goo.gl/SC7cgQ'\r\n );\r\n });\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 React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport \"regenerator-runtime/runtime\";\r\nimport * as Flex from \"@twilio/flex-ui\";\r\nimport \"./index.css\";\r\nimport App from \"./App\";\r\nimport registerServiceWorker from \"./registerServiceWorker\";\r\n\r\nconst mountNode = document.getElementById(\"root\");\r\n\r\nwindow.onload = () => {\r\n const predefinedConfig = window.appConfig || {};\r\n\r\n const configuration = {\r\n ...predefinedConfig,\r\n };\r\n\r\n Flex\r\n .progress(mountNode)\r\n .provideLoginInfo(configuration, mountNode)\r\n .then(() => Flex.Manager.create(configuration))\r\n .then(manager => renderApp(manager))\r\n .catch(error => handleError(error));\r\n};\r\nFlex.MainHeader.defaultProps.logoUrl = \"assets/logo_small.png\"\r\n\r\n\r\nfunction renderApp(manager) {\r\n ReactDOM.render(\r\n ,\r\n mountNode\r\n );\r\n}\r\n\r\nfunction handleError(error) {\r\n Flex.errorPage(error, mountNode);\r\n console.error(\"Failed to initialize Flex\", error);\r\n}\r\n\r\nregisterServiceWorker();\r\n"],"sourceRoot":""}