{"version":3,"sources":["../ /^/.//.*/.svg$/ groupOptions: {} namespace object","theme/defaultTheme.ts","theme/GlobalStyle.ts","components/Button.tsx","components/Icon.tsx","components/typography.tsx","hooks/useSystem.ts","services/SessionService.ts","components/Notification/Modal.tsx","components/Notification/index.tsx","App.tsx","serviceWorker.ts","index.tsx","Providers.tsx"],"names":["map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","id","keys","Object","module","exports","defaultTheme","colors","primary100","primaryDisabled","gray100","grayDark","gray30","gray10","white","shadows","elevation2","EButtonType","GlobalStyle","createGlobalStyle","theme","Button","props","text","buttonType","onClick","buttonWidth","className","ButtonComponent","ButtonBase","primary","PrimaryButton","secondary","SecondaryButton","Text","defaultProps","styled","button","gray20","div","IconWrapper","iconWidth","undefined","color","TypoH2","TypoSubheader","TypoBodyRegular","useSystem","match","useRouteMatch","path","strict","sensitive","params","system","SessionService","getSessionDuration","a","fetch","res","ok","json","expired","date","prolongSession","method","redirectToTiles","errorCode","window","parent","location","href","setIframeDisplay","display","iframe","document","getElementById","style","showIframe","root","filter","hideIframe","getConfig","logout","catch","error","logWarn","message","console","warn","HideBodyOverflow","Modal","handleProlong","resetTimer","setTimer","Mask","Wrapper","stopPropagation","ModalContent","StyledIcon","name","width","StyledTypoH2","Separator","ButtonsContainer","StyledButton","ImportedIconRef","useRef","useState","loading","setLoading","useEffect","isComponentMounted","namedImport","default","current","ImportedIcon","Notification","Container","App","timerRef","lastMilisecondsOfSession","setLastMilisecondsOfSession","notificationInterval","setNotificationInterval","init","useCallback","difference","Math","max","differenceInMilliseconds","Date","clearTimeout","setTimeout","Boolean","hostname","parentPath","pathname","isWhitelisted","some","whitelistedPath","startsWith","ReactDOM","render","basename","process","navigator","serviceWorker","ready","registration","unregister"],"mappings":"6JAAA,IAAIA,EAAM,CACT,eAAgB,CACf,IACA,IAGF,SAASC,EAAoBC,GAC5B,IAAIC,EAAoBC,EAAEJ,EAAKE,GAC9B,OAAOG,QAAQC,U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"static/js/main.eab67e9e.chunk.js","sourcesContent":["var map = {\n\t\"./logout.svg\": [\n\t\t298,\n\t\t3\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 293;\nmodule.exports = webpackAsyncContext;","export type TTheme = typeof defaultTheme;\n\nexport const defaultTheme = {\n colors: {\n // PRIMARY\n primary100: \"#055A60\",\n primaryDisabled: \"#78ADB0\",\n\n // GRAY\n gray100: \"#2F2F2F\",\n grayDark: \"#181818\",\n gray30: \"#E3E3E3\",\n gray10: \"#F3F3F3\",\n\n // MISC\n white: \"#FFFFFF\"\n },\n shadows: {\n elevation2: \"0px 1px 2px rgba(10, 27, 56, 0.08), 0px 2px 4px rgba(10, 27, 56, 0.12)\"\n }\n};\n\nexport type TDefaultThemeColor = keyof typeof defaultTheme.colors;\n","import { createGlobalStyle } from \"styled-components/macro\";\nimport { TTheme } from \"./defaultTheme\";\n\nexport const GlobalStyle = createGlobalStyle`\n body {\n background-color: ${({ theme }: { theme: TTheme }) => theme.colors.gray10};\n font-family: \"Nunito Sans\", sans-serif;\n font-size: 16px;\n line-height: 20px;\n font-weight: 400;\n color: ${({ theme }) => theme.colors.gray100};\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-overflow-scrolling: touch;\n\n *, *:before, *:after {\n box-sizing: border-box;\n transition-duration: 0.25s;\n transition-timing-function: ease-in-out;\n transition-property: color, background-color, padding, border-color, border-width, box-shadow, stroke, fill;\n }\n\n a {\n color: ${({ theme }) => theme.colors.primary100};\n font-weight: 700;\n\n &:hover {\n color: ${({ theme }) => theme.colors.gray100};\n text-decoration: none;\n }\n\n &:active {\n text-decoration: underline;\n }\n }\n }\n`;\n","import React, { FC, MouseEvent } from \"react\";\nimport styled from \"styled-components/macro\";\n\nexport enum EButtonType {\n primary = \"primary\",\n primaryBlack = \"primaryBlack\",\n secondary = \"secondary\"\n}\ninterface IButtonProps {\n text: string;\n onClick: (e: MouseEvent) => void;\n buttonType?: keyof typeof EButtonType;\n buttonWidth?: string;\n className?: string;\n}\n\nexport const Button: FC = props => {\n const { text, buttonType, onClick, buttonWidth, className } = props;\n\n let ButtonComponent = ButtonBase;\n\n if (buttonType === EButtonType.primary) ButtonComponent = PrimaryButton;\n if (buttonType === EButtonType.secondary) ButtonComponent = SecondaryButton;\n\n return (\n \n {text}\n \n );\n};\n\nButton.defaultProps = {\n buttonType: EButtonType.primary\n};\n\nconst ButtonBase = styled.button<{ buttonWidth?: string }>`\n font-weight: 700;\n color: ${({ theme }) => theme.colors.white};\n padding: 0 24px;\n border-width: 0;\n outline: 0;\n cursor: pointer;\n display: inline-flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n ${({ buttonWidth }) => buttonWidth && `width: ${buttonWidth}`};\n\n min-width: 128px;\n max-width: 400px;\n height: 44px;\n\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nconst PrimaryButton = styled(ButtonBase)`\n background-color: ${({ theme }) => theme.colors.primary100};\n\n &:hover:not(:disabled) {\n background-color: ${({ theme }) => theme.colors.grayDark};\n }\n\n &:disabled {\n background-color: ${({ theme }) => theme.colors.primaryDisabled};\n }\n`;\n\nconst SecondaryButton = styled(ButtonBase)`\n background-color: ${({ theme }) => theme.colors.white};\n color: ${({ theme }) => theme.colors.grayDark};\n border: 2px solid;\n border-color: ${({ theme }) => theme.colors.gray30};\n\n &:hover:not(:disabled) {\n border-color: ${({ theme }) => theme.colors.primary100};\n\n * {\n color: ${({ theme }) => theme.colors.primary100};\n }\n }\n\n &:disabled {\n background-color: ${({ theme }) => theme.colors.gray20};\n }\n`;\n\nconst Text = styled.div`\n display: flex;\n align-items: center;\n`;\n","import React, { FC, SVGProps, useEffect, useRef, useState } from \"react\";\nimport styled from \"styled-components/macro\";\nimport { TDefaultThemeColor } from \"../theme/defaultTheme\";\n\ninterface IIconProps extends SVGProps {\n name: string;\n width?: number;\n className?: string;\n onClick?: (e?: any) => void;\n color?: TDefaultThemeColor;\n}\n\nexport const Icon: FC = (props): JSX.Element | null => {\n const { name, width, className, onClick, color } = props;\n const ImportedIconRef = useRef>>();\n const [loading, setLoading] = useState(false);\n\n useEffect(() => {\n let isComponentMounted = true;\n setLoading(true);\n\n (async (): Promise => {\n try {\n const { default: namedImport } = await import(\n `!!@svgr/webpack?-svgo,+titleProp,+ref!../assets/icons/${name}.svg`\n );\n ImportedIconRef.current = namedImport;\n } catch (err) {\n throw err;\n } finally {\n isComponentMounted && setLoading(false);\n }\n })();\n\n return () => {\n isComponentMounted = false;\n };\n }, [name]);\n\n if (loading || !ImportedIconRef.current) return null;\n\n const { current: ImportedIcon } = ImportedIconRef;\n\n return (\n \n \n \n );\n};\n\nconst IconWrapper = styled.div<{\n iconWidth?: number;\n onClick?: () => void;\n color?: TDefaultThemeColor;\n}>`\n display: inline-block;\n cursor: ${({ onClick }) => (!!onClick ? \"pointer\" : \"inherit\")};\n\n > svg {\n ${({ iconWidth }) => iconWidth !== undefined && `width: ${iconWidth}px;`}\n height: 100%;\n display: block;\n }\n\n ${({ color, theme }) =>\n color &&\n `\n svg g {\n &, path, circle, rect {\n stroke: ${theme.colors[color]} !important;\n }\n\n rect {\n fill: ${theme.colors[color]} !important;\n }\n\n tspan {\n stroke: transparent !important;\n fill: ${theme.colors[color]} !important;\n }\n }\n\n svg > path {\n stroke: ${theme.colors[color]} !important;\n }\n `};\n`;\n","import styled from \"styled-components/macro\";\n\nexport const TypoH2 = styled.div`\n font-weight: 600;\n font-size: 32px;\n line-height: 40px;\n`;\n\nexport const TypoSubheader = styled.div`\n font-weight: 400;\n font-size: 18px;\n line-height: 24px;\n`;\n\nexport const TypoBodyRegular = styled.div`\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n`;\n","import { useRouteMatch } from \"react-router\";\n\nexport const useSystem = () => {\n const match = useRouteMatch<{ system: string }>({\n path: \"/app/:system\",\n strict: false,\n sensitive: false\n });\n return match?.params.system || \"TILES\";\n};\n","import { SessionDuration } from \"../models/SessionDuration\";\nimport { ConfigValues } from \"../models/ConfigValues\";\n\ntype rtt = () => void;\ntype rtt2 = (system: string, errorCode: string) => void;\n\nexport default class SessionService {\n public static getSessionDuration = async (system: string): Promise => {\n const res = await fetch(`/status/api/session/duration/${system}`);\n if (res.ok) {\n const json = await res.json();\n return { expired: false, date: json.date };\n } else {\n return { expired: true, date: \"\" };\n }\n };\n\n public static prolongSession = (system: string) => {\n return fetch(`/status/api/session/prolong/${system}`, { method: \"PUT\" });\n };\n\n public static redirectToTiles: rtt & rtt2 = (system?: string, errorCode?: string) => {\n // TODO: Handle error codes\n window.parent.location.href = errorCode ? `/home/error/${system}/${errorCode}` : \"/home/logout\";\n };\n\n private static setIframeDisplay = (display: \"block\" | \"none\") => {\n const iframe = window.parent.document.getElementById(\"sessionExtender\");\n if (iframe) {\n iframe.style.display = display;\n }\n };\n\n public static showIframe = () => {\n SessionService.setIframeDisplay(\"block\");\n const root = window.parent.document.getElementById(\"root\");\n if (root) {\n root.style.filter = \"blur(10px)\";\n }\n };\n public static hideIframe = () => {\n SessionService.setIframeDisplay(\"none\");\n const root = window.parent.document.getElementById(\"root\");\n if (root) {\n root.style.filter = \"\";\n }\n };\n\n public static getConfig = (): Promise =>\n fetch(\"/status/api/config\").then(res => res.json());\n\n public static logout = () => {\n return fetch(\"/home/api/session\", { method: \"DELETE\" })\n .then(() => SessionService.redirectToTiles())\n .catch(error => {\n // TODO: Handle failed logout (error codes)\n SessionService.logWarn(error, \"Logout failed\");\n SessionService.redirectToTiles();\n });\n };\n\n public static logWarn = (error: any, message: string = \"\") => {\n console.warn(`SESSION STATUS: ${message}`);\n console.warn(error);\n };\n}\n","import React from \"react\";\nimport styled, { createGlobalStyle } from \"styled-components/macro\";\nimport { TTheme } from \"../../theme/defaultTheme\";\nimport { Button, EButtonType } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { TypoBodyRegular, TypoH2, TypoSubheader } from \"../typography\";\nimport { useSystem } from \"../../hooks/useSystem\";\nimport SessionService from \"../../services/SessionService\";\n\nconst HideBodyOverflow = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\ninterface ModalProps {\n setTimer: () => void;\n resetTimer: () => void;\n}\n\nexport const Modal = (props: ModalProps) => {\n const system = useSystem();\n const handleLogout = () => {\n SessionService.logout();\n };\n\n const handleProlong = async () => {\n props.resetTimer();\n try {\n const { expired } = await SessionService.getSessionDuration(system);\n if (!expired) {\n await SessionService.prolongSession(system);\n props.setTimer();\n SessionService.hideIframe();\n } else {\n SessionService.redirectToTiles();\n }\n } catch (error) {\n SessionService.logWarn(error, \"Couldn't prolong session\");\n SessionService.redirectToTiles();\n }\n };\n\n return (\n \n \n e.stopPropagation()}>\n \n \n Twoja sesja wkrótce wygaśnie\n \n Ze względu na brak aktywności nastąpi automatyczne wylogowanie\n \n \n \n \n {\n e.stopPropagation();\n handleLogout();\n }}\n text={\"Wyloguj\"}\n buttonType={EButtonType.secondary}\n />\n\n {\n e.stopPropagation();\n handleProlong();\n }}\n text={\"Przedłuż sesję\"}\n />\n \n \n \n );\n};\n\nconst Mask = styled.div`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 999;\n padding: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:before {\n content: \"\";\n z-index: -1;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0.6;\n background-color: ${({ theme }: { theme: TTheme }) => theme.colors.gray100};\n }\n`;\n\nconst Wrapper = styled.div`\n background-color: ${({ theme }) => theme.colors.gray10};\n max-width: 640px;\n margin-top: -240px;\n width: 100%;\n display: block;\n box-shadow: ${({ theme }) => theme.shadows.elevation2};\n`;\n\nconst ModalContent = styled(TypoSubheader)`\n padding: 32px 24px;\n max-height: calc(100vh - 250px);\n white-space: break-spaces;\n text-align: center;\n flex-direction: column;\n word-wrap: break-word;\n overflow: auto;\n`;\n\nconst StyledIcon = styled(Icon)`\n margin-bottom: 24px;\n`;\n\nconst StyledTypoH2 = styled(TypoH2)`\n color: ${({ theme }) => theme.colors.primary100};\n margin-bottom: 24px;\n`;\n\nconst Separator = styled.div`\n height: 1px;\n background-color: ${({ theme }) => theme.colors.gray30};\n`;\n\nconst ButtonsContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n padding: 16px 0;\n`;\n\nconst StyledButton = styled(Button)`\n margin-right: 16px;\n`;\n","import React from \"react\";\nimport styled from \"styled-components/macro\";\nimport { Modal } from \"./Modal\";\n\ninterface NotificationProps {\n setTimer: () => void;\n resetTimer: () => void;\n}\n\nexport const Notification = (props: NotificationProps) => {\n return (\n \n \n \n );\n};\n\nconst Container = styled.div`\n height: 100%;\n width: 100%;\n`;\n","import React, { useEffect, useRef, useCallback, useState } from \"react\";\nimport styled from \"styled-components/macro\";\nimport { Notification } from \"./components/Notification\";\nimport SessionService from \"./services/SessionService\";\nimport differenceInMilliseconds from \"date-fns/differenceInMilliseconds\";\nimport { useSystem } from \"./hooks/useSystem\";\n\nexport const App = () => {\n const timerRef = useRef>();\n const [lastMilisecondsOfSession, setLastMilisecondsOfSession] = useState(0);\n const [notificationInterval, setNotificationInterval] = useState(0);\n\n const system = useSystem();\n\n useEffect(() => {\n const init = async () => {\n try {\n SessionService.prolongSession(system); // Assure that session is as fresh as possible\n const { lastMilisecondsOfSession, notificationInterval } = await SessionService.getConfig();\n setLastMilisecondsOfSession(lastMilisecondsOfSession);\n setNotificationInterval(notificationInterval);\n } catch (error) {\n setLastMilisecondsOfSession(180000);\n setNotificationInterval(1020000);\n SessionService.logWarn(error, \"Couldn't get config\");\n }\n };\n init();\n }, [setLastMilisecondsOfSession, setNotificationInterval, system]);\n\n const setTimer = useCallback(async () => {\n try {\n const { date, expired } = await SessionService.getSessionDuration(system);\n if (!expired) {\n const difference = Math.max(0, differenceInMilliseconds(new Date(date), new Date()));\n clearTimeout(timerRef.current);\n if (difference <= lastMilisecondsOfSession) {\n SessionService.showIframe();\n timerRef.current = setTimeout(setTimer, difference + 1000);\n } else {\n timerRef.current = setTimeout(setTimer, difference - lastMilisecondsOfSession);\n }\n } else {\n SessionService.redirectToTiles();\n }\n } catch (error) {\n SessionService.logWarn(error, \"Couldn't get session duration\");\n SessionService.showIframe();\n }\n }, [lastMilisecondsOfSession, system]);\n\n const resetTimer = () => clearTimeout(timerRef.current);\n\n useEffect(() => {\n if (notificationInterval !== 0) {\n timerRef.current = setTimeout(setTimer, notificationInterval);\n }\n return () => clearTimeout(timerRef.current);\n }, [setTimer, notificationInterval]);\n\n return (\n \n \n \n );\n};\n\nconst Wrapper = styled.div`\n text-align: center;\n`;\n","// 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.0/8 are considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: 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: string, config?: 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: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { \"Service-Worker\": \"script\" }\n })\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(\"No internet connection found. App is running in offline mode.\");\n });\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","// This must be the first line in src/index.tsx\n// tslint:disable-next-line: no-implicit-dependencies\nimport \"react-app-polyfill/stable\";\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport { Providers } from \"./Providers\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nconst parentPath = window.parent.location.pathname;\n\nconst pathWhitelist = [\n \"/home/change-login\",\n \"/home/change-password\",\n \"/home/confirm-login\",\n \"/home/create-document-password\",\n \"/home/change-document-password\"\n];\nconst isWhitelisted = pathWhitelist.some(whitelistedPath => parentPath.startsWith(whitelistedPath));\n\nif (!parentPath.startsWith(\"/home\") || isWhitelisted) {\n ReactDOM.render(, document.getElementById(\"root\"));\n}\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();\n","import React, { FC } from \"react\";\nimport { ThemeProvider } from \"styled-components/macro\";\nimport { Normalize } from \"styled-normalize\";\nimport { BrowserRouter, MemoryRouter } from \"react-router-dom\";\n\nimport { defaultTheme } from \"./theme/defaultTheme\";\nimport { GlobalStyle } from \"./theme/GlobalStyle\";\n\nimport { App } from \"./App\";\n\nexport const Providers: FC = () => (\n \n
\n \n \n \n \n \n
\n
\n);\n\nexport const TestProviders: FC = ({ children }) => (\n \n
\n \n {children}\n
\n
\n);\n"],"sourceRoot":""}