\r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\nexport default withRouter(Carriers);\r\n","import React from \"react\";\r\nimport { Carriers, Fail } from \"pages\";\r\nimport { BrowserRouter as Router, Switch, Route, Link } from \"react-router-dom\";\r\n\r\nexport const Routes = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n );\r\n};\r\n","/* eslint-disable react/prop-types */\r\nimport React from 'react';\r\nimport Context from './context';\r\nexport default class GlobalState extends React.Component {\r\n state = {\r\n _step: 1,\r\n };\r\n\r\n setStep = (step: any) => {\r\n this.setState({ _step: step });\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n","import \"./i18n\";\r\nimport React, { useLayoutEffect } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { unstable_createMuiStrictModeTheme as createMuiTheme } from \"@material-ui/core\";\r\n\r\nimport { ThemeProvider } from \"@material-ui/core/styles\";\r\nimport { Shadows } from \"@material-ui/core/styles/shadows\";\r\nimport { create } from \"jss\";\r\nimport rtl from \"jss-rtl\";\r\nimport { StylesProvider, jssPreset } from \"@material-ui/core/styles\";\r\n\r\nimport { Routes } from \"routes\";\r\nimport GlobalState from \"core/context/GlobalState\";\r\nconst win: any = window;\r\nconst isRTL = win[\"lang\"] === \"ar\";\r\n\r\nconst apptheme = createMuiTheme({\r\n direction: \"rtl\",\r\n shadows: Array(25).fill(\"none\") as Shadows,\r\n typography: {\r\n fontSize: 12,\r\n fontFamily: isRTL\r\n ? \"ExpoArabic-Medium\"\r\n : '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\"',\r\n },\r\n\r\n palette: {\r\n text: {\r\n primary: \"#000000\",\r\n secondary: \"#72767A\",\r\n },\r\n primary: {\r\n main: \"#606060\",\r\n light: \"#d4d4d0\",\r\n dark: \"#000000\",\r\n },\r\n secondary: {\r\n main: \"#008CFF\",\r\n },\r\n contrastThreshold: 3,\r\n },\r\n});\r\n\r\nexport default function App() {\r\n const win: any = window;\r\n const { i18n } = useTranslation();\r\n // win['lang'] = 'en-US';\r\n // win['lang'] = 'ar';\r\n const langDir = i18n.dir(win[\"lang\"] as string);\r\n const isRTL = langDir === \"rtl\";\r\n\r\n document.body.setAttribute(\"dir\", isRTL ? \"rtl\" : \"ltr\");\r\n const jss = isRTL\r\n ? create({ plugins: [...jssPreset().plugins, rtl()] })\r\n : create({ plugins: [...jssPreset().plugins] });\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\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 subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\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.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/),\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\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.href);\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/facebook/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. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\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://bit.ly/CRA-PWA',\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.',\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\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 // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\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: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1)) {\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, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { Suspense } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport App from 'App';\r\nimport 'fontsource-roboto/500.css';\r\nimport './styles.css';\r\nimport * as serviceWorker from './serviceWorker';\r\n\r\nReactDOM.render(\r\n \r\n }>\r\n \r\n \r\n ,\r\n document.getElementById('root'),\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}