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AM,MAAO,gBAAiBA,EAAM,OAAQ,KAAMc,EAAM0B,WAAY,KAAMxC,EAAM,KAAM,MAAOA,EAAM,KAAM,MAAOA,EAAM,IAAK,KAAM,4BAA6BA,EAAM,KAAM,MAAO,kBAAmBA,EAAM,IAAK,KAAM,MAAOA,EAAM,KAAM,MAAO,gBAAiBA,EAAM,IAAK,KAAM,MAAOA,EAAM,KAAM,MAAO,iBAAkBA,EAAM,IAAK,KAAM,MAAOA,EAAM,KAAM,MAAO,cA2EthB,O,sBC9GFyC,OAAOC,SAAWD,OAAOC,UAAY,IAAIV,KAAK,CAC7C,IACA,WACE,OAAO,EAAQ,W","sources":["webpack://_N_E/./src/pages/index.tsx","webpack://_N_E/"],"sourcesContent":["var _process$env$NEXT_PUB;\n\nimport React from \"react\";\nvar __jsx = React.createElement;\nimport { setModuleLoader } from '@monofe/ui-workspace/common/loader';\nimport { IFeatureStatus, IFeatureType, injectFeatureQuery, injectLog } from '@monofe/util';\nimport * as Sentry from '@sentry/react';\nimport { BrowserTracing } from '@sentry/tracing';\nimport { useRouter } from 'next/dist/client/router';\nimport dynamic from 'next/dynamic';\nimport { useEffect, useState } from 'react';\nimport getHref from '../utils/href';\nimport loadSession from '../utils/session';\nimport { injectSiteConfig } from '../utils/siteConfig';\nconst SENTRY_URL = 'https://2dc1a157019a40a7ba9478024edae45b@o1406798.ingest.sentry.io/6741062';\n/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/dot-notation */\n\nconst BUILD_ENVIRONMENT = String(process.env['NODE_ENV']) || 'unknown';\nconst SCM_HASH = (_process$env$NEXT_PUB = process.env['NEXT_PUBLIC_SCM_HASH']) !== null && _process$env$NEXT_PUB !== void 0 ? _process$env$NEXT_PUB : 'scm_hash_unknown';\nconst TRACE_SAMPLE_RATE_PRODUCTION = 0.2;\n/* 20PC */\n\nconst TRACE_SAMPLE_RATE_DEVELOPMENT = 1.0;\n/* 100PC */\n\nconst StyleNoScript = {\n zIndex: 9000,\n overflowY: 'scroll',\n textAlign: 'center',\n color: 'white'\n};\n\nfunction browserUnsupportedView(props) {\n return __jsx(\"main\", {\n id: \"invalid-browser\",\n style: StyleNoScript\n }, __jsx(\"p\", null, \"This browser is missing some features to work with '\", props.siteName, \"',\", __jsx(\"br\", null), \"please consult your devices documentation to update.\", __jsx(\"br\", null), \"(error code: \", __jsx(\"span\", null, props.errorCode), \")\"), __jsx(\"br\", null), __jsx(\"br\", null), __jsx(\"p\", null, \"Please upgrade to either:\", __jsx(\"br\", null), \"Safari v11.1+, \", __jsx(\"i\", null, \"or\"), __jsx(\"br\", null), \"Chrome v63+, \", __jsx(\"i\", null, \"or\"), __jsx(\"br\", null), \"Firefox v67+, \", __jsx(\"i\", null, \"or\"), __jsx(\"br\", null), \"Edge v79+\"));\n}\n\nexport const getStaticProps = async () => {\n const workspace = await loadSession();\n const config = injectSiteConfig();\n const href = await getHref('LanguageSelect', {\n db: workspace.db\n });\n return {\n props: {\n destination: href,\n environment: BUILD_ENVIRONMENT,\n\n /* Sentry expects the release id to be the git hash */\n release: SCM_HASH,\n siteName: config.appLongName\n }\n };\n};\n\nfunction useFeatureStatus() {\n const {\n 0: featureCheckResult,\n 1: setFeatureCheckResult\n } = useState(IFeatureStatus.FeatureStatusUndef);\n useEffect(() => {\n injectFeatureQuery().featuresSupported([IFeatureType.FeatureTypeSymbol, IFeatureType.FeatureTypeModule, IFeatureType.FeatureTypeIndexedDB]).then(result => {\n setFeatureCheckResult(result);\n }).catch(error => {\n injectLog().error(error.message);\n });\n }, []);\n return featureCheckResult;\n}\n\nfunction Index(_ref) {\n let {\n destination,\n environment,\n release,\n siteName\n } = _ref;\n setModuleLoader(dynamic, {});\n /* In order to redirect from root to the first displayable page\n we must wait until the view is hydrated and then update the router */\n\n const router = useRouter();\n const featureCheckResult = useFeatureStatus();\n const isRoutable = featureCheckResult === IFeatureStatus.FeatureStatusSupported;\n useEffect(() => {\n if (!isRoutable) {\n return;\n }\n\n router.push(destination).catch(error => {\n throw error;\n });\n Sentry.init({\n dsn: SENTRY_URL,\n integrations: [new BrowserTracing()],\n environment,\n release,\n tracesSampleRate: environment === 'production' ? TRACE_SAMPLE_RATE_PRODUCTION : TRACE_SAMPLE_RATE_DEVELOPMENT\n });\n }, [destination, environment, release, router, isRoutable]);\n /* \n Display an empty fragment if we are waiting for the feature check to complete (FeatureStatusUndef)\n or if the feature check is successful (Feature StatusSupported) in which case we redirect to new page\n */\n\n const showUnsupportedView = featureCheckResult === IFeatureStatus.FeatureStatusUnsupported;\n return showUnsupportedView ? browserUnsupportedView({\n siteName,\n errorCode: featureCheckResult\n }) : null;\n}\n\nexport default Index;","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/\",\n function () {\n return require(\"private-next-pages/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/\"])\n });\n }\n "],"names":["__jsx","React","StyleNoScript","zIndex","overflowY","textAlign","color","_ref","destination","environment","release","siteName","setModuleLoader","dynamic","props","router","useRouter","featureCheckResult","useState","IFeatureStatus","setFeatureCheckResult","useEffect","injectFeatureQuery","featuresSupported","IFeatureType","then","result","error","injectLog","message","useFeatureStatus","isRoutable","push","Sentry","dsn","integrations","BrowserTracing","tracesSampleRate","id","style","errorCode","window","__NEXT_P"],"sourceRoot":""}