{"version":3,"sources":["App.js","registerServiceWorker.js","index.js"],"names":["Home","React","lazy","AdminPortal","MerchantPortal","translateVersion","App","props","window","swal","Swal","Object","keys","map","k","localStorage","getItem","removeItem","Suspense","fallback","Switch","Route","path","component","Component","displayName","name","formatNum","val","min","max","parseFloat","toLocaleString","minimumFractionDigits","maximumFractionDigits","Boolean","location","hostname","match","baseUrl","document","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","render","BrowserRouter","basename","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"uQAMMA,G,OAAOC,IAAMC,MAAK,kBAAM,oEACxBC,EAAcF,IAAMC,MAAK,kBAAM,gFAC/BE,EAAiBH,IAAMC,MAAK,kBAAM,wEAElCG,EAAmB,CACvB,iBAAkB,EAClB,iBAAkB,GAGCC,E,YAEjB,WAAYC,GAAO,OAAC,oBAChBC,OAAOC,KAAOC,IACdC,OAAOC,KAAKP,GAAkBQ,KAAI,SAASC,GACrCC,aAAaC,QAAQF,EAAE,UAASC,aAAaD,EAAE,QAAUT,EAAiBS,IAC3ET,EAAiBS,IAAMC,aAAaD,EAAE,UACvCC,aAAaD,EAAE,QAAUT,EAAiBS,GAC1CC,aAAaE,WAAWH,OANb,0CASTP,I,sEAiBN,OACI,kBAAC,IAAMW,SAAP,CAAgBC,UAAU,GACtB,kBAACC,EAAA,EAAD,KACI,kBAACC,EAAA,EAAD,CAAOC,KAAK,SAASC,UAAWpB,IAChC,kBAACkB,EAAA,EAAD,CAAOC,KAAK,YAAYC,UAAWnB,IACnC,kBAACiB,EAAA,EAAD,CAAOC,KAAK,IAAIC,UAAWvB,U,GAjCdwB,aAAZlB,EAcVmB,YAAcnB,EAAIoB,KAdRpB,EAgBVqB,UAAY,SAASC,EAAKC,EAAKC,GAIlC,OAHKD,IAAKA,EAAM,GACXC,IAAKA,EAAM,GACXF,IAAKA,EAAM,GACRG,WAAWH,GAAMI,eACrB,QAEA,CAAEC,sBAAuBJ,EAAKK,sBAAuBJ,KC5B7CK,QACW,cAA7B3B,OAAO4B,SAASC,UAEa,UAA7B7B,OAAO4B,SAASC,UAEhB7B,OAAO4B,SAASC,SAASC,MACvB,2DCLJ,IAAMC,EAAUC,SAASC,qBAAqB,QAAQ,GAAGC,aAAa,QAChEC,EAAcH,SAASI,eAAe,QAE5CC,IAASC,OACP,kBAACC,EAAA,EAAD,CAAeC,SAAUT,GACvB,kBAAC,EAAD,OAEFI,GDoFI,kBAAmBM,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,iB","file":"static/js/main.864f5d66.chunk.js","sourcesContent":["import React, { Component } from 'react';\r\nimport { Route, Switch } from \"react-router-dom\";\r\nimport Swal from 'sweetalert2';\r\n\r\nimport './custom.css'\r\n\r\nconst Home = React.lazy(() => import('./components/Customer/Home'));\r\nconst AdminPortal = React.lazy(() => import('./components/Admin/AdminPortal'));\r\nconst MerchantPortal = React.lazy(() => import('./components/Merchant/MerchantPortal'));\r\n\r\nconst translateVersion = {\r\n  \"application-en\": 8,\r\n  \"application-fr\": 8\r\n};\r\n\r\nexport default class App extends Component {\r\n\r\n    constructor(props) {\r\n        window.swal = Swal;\r\n        Object.keys(translateVersion).map(function(k){\r\n          if(!localStorage.getItem(k+'-ver')) localStorage[k+'-ver'] = translateVersion[k];\r\n          if(translateVersion[k] >= localStorage[k+'-ver']){\r\n            localStorage[k+'-ver'] = translateVersion[k];\r\n            localStorage.removeItem(k);\r\n          }\r\n        });\r\n        super(props);\r\n    }\r\n\r\n    static displayName = App.name;\r\n\r\n    static formatNum = function(val, min, max) {\r\n        if (!min) min = 2;\r\n        if (!max) max = 2;\r\n        if (!val) val = 0;\r\n        return (parseFloat(val)).toLocaleString(\r\n            'en-US', // leave undefined to use the visitor's browser\r\n            // locale or a string like 'en-US' to override it.\r\n            { minimumFractionDigits: min, maximumFractionDigits: max }\r\n        );\r\n    }\r\n\r\n    render() {\r\n        return (\r\n            <React.Suspense fallback={false}>\r\n                <Switch>\r\n                    <Route path='/admin' component={AdminPortal} />\r\n                    <Route path='/merchant' component={MerchantPortal} />\r\n                    <Route path='/' component={Home} />\r\n                </Switch>\r\n            </React.Suspense>\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 'react-app-polyfill/ie9';\r\nimport 'react-app-polyfill/ie11';\r\nimport 'bootstrap/dist/css/bootstrap.css';\r\n\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport App from './App';\r\n//import registerServiceWorker from './registerServiceWorker';\r\nimport { unregister } from './registerServiceWorker';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n  <BrowserRouter basename={baseUrl}>\r\n    <App />\r\n  </BrowserRouter>,\r\n  rootElement);\r\n\r\n//registerServiceWorker();\r\nunregister();"],"sourceRoot":""}