{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nimport Constants, { ExecutionEnvironment } from 'expo-constants';\nimport * as React from 'react';\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport DevLoadingView from \"../environment/DevLoadingView\";\nexport function withDevTools(AppRootComponent) {\n var useOptionalKeepAwake = function () {\n if (Platform.OS !== 'web') {\n try {\n var _require = require('expo-keep-awake'),\n useKeepAwake = _require.useKeepAwake,\n ExpoKeepAwakeTag = _require.ExpoKeepAwakeTag;\n return function () {\n return useKeepAwake(ExpoKeepAwakeTag, {\n suppressDeactivateWarnings: true\n });\n };\n } catch (_unused) {}\n }\n return function () {};\n }();\n var shouldUseExpoFastRefreshView = Platform.select({\n web: true,\n ios: Constants.executionEnvironment !== ExecutionEnvironment.Bare,\n default: false\n });\n function WithDevTools(props) {\n useOptionalKeepAwake();\n if (shouldUseExpoFastRefreshView) {\n return React.createElement(React.Fragment, null, React.createElement(AppRootComponent, _objectSpread({}, props)), React.createElement(DevLoadingView, null));\n }\n return React.createElement(AppRootComponent, _objectSpread({}, props));\n }\n var name = AppRootComponent.displayName || AppRootComponent.name || 'Anonymous';\n WithDevTools.displayName = \"withDevTools(\" + name + \")\";\n return WithDevTools;\n}","map":{"version":3,"sources":["../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import Constants, { ExecutionEnvironment } from 'expo-constants';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport DevLoadingView from '../environment/DevLoadingView';\n\n/**\n * Append the Expo Fast Refresh view and optionally\n * keep the screen awake if `expo-keep-awake` is installed.\n */\nexport function withDevTools>(\n AppRootComponent: TComponent\n): React.ComponentType> {\n // This hook can be optionally imported because __DEV__ never changes during runtime.\n // Using __DEV__ like this enables tree shaking to remove the hook in production.\n const useOptionalKeepAwake: (tag?: string) => void = (() => {\n if (Platform.OS !== 'web') {\n try {\n // Optionally import expo-keep-awake\n const { useKeepAwake, ExpoKeepAwakeTag } = require('expo-keep-awake');\n return () => useKeepAwake(ExpoKeepAwakeTag, { suppressDeactivateWarnings: true });\n } catch {}\n }\n\n return () => {};\n })();\n\n const shouldUseExpoFastRefreshView = Platform.select({\n web: true,\n ios: Constants.executionEnvironment !== ExecutionEnvironment.Bare,\n default: false,\n });\n\n function WithDevTools(props: React.ComponentProps) {\n useOptionalKeepAwake();\n\n if (shouldUseExpoFastRefreshView) {\n return (\n <>\n \n \n \n );\n }\n\n return ;\n }\n\n const name = AppRootComponent.displayName || AppRootComponent.name || 'Anonymous';\n WithDevTools.displayName = `withDevTools(${name})`;\n\n return WithDevTools;\n}\n"],"sourceRoot":""},"metadata":{},"sourceType":"module"}