{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"visible\", \"children\", \"style\"];\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nimport * as React from 'react';\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nvar FAR_FAR_AWAY = 30000;\nexport default function ResourceSavingScene(_ref) {\n var visible = _ref.visible,\n children = _ref.children,\n style = _ref.style,\n rest = _objectWithoutProperties(_ref, _excluded);\n if (Platform.OS === 'web') {\n return React.createElement(View, _extends({\n hidden: !visible,\n style: [{\n display: visible ? 'flex' : 'none'\n }, styles.container, style],\n pointerEvents: visible ? 'auto' : 'none'\n }, rest), children);\n }\n return React.createElement(View, {\n style: [styles.container, style],\n pointerEvents: visible ? 'auto' : 'none'\n }, React.createElement(View, {\n collapsable: false,\n removeClippedSubviews: Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true,\n pointerEvents: visible ? 'auto' : 'none',\n style: visible ? styles.attached : styles.detached\n }, children));\n}\nvar styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden'\n },\n attached: {\n flex: 1\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY\n }\n});","map":{"version":3,"sources":["ResourceSavingView.tsx"],"names":["React","FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA;AAAA;AAAA;AAS9B,IAAMC,YAAY,GAAG,KAAK;AAE1B,eAAe,SAASC,mBAAmB,CAA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IACRG,IAAI,EAAE,CAAC;IACPE,GAAG,EAAEjB;EACP;AACF,CAAC,CAAC","sourceRoot":"../../src","sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nconst FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container\n\nexport default function ResourceSavingScene(_ref) {\n let {\n visible,\n children,\n style,\n ...rest\n } = _ref;\n if (Platform.OS === 'web') {\n return /*#__PURE__*/React.createElement(View\n // @ts-expect-error: hidden exists on web, but not in React Native\n , _extends({\n hidden: !visible,\n style: [{\n display: visible ? 'flex' : 'none'\n }, styles.container, style],\n pointerEvents: visible ? 'auto' : 'none'\n }, rest), children);\n }\n return /*#__PURE__*/React.createElement(View, {\n style: [styles.container, style]\n // box-none doesn't seem to work properly on Android\n ,\n pointerEvents: visible ? 'auto' : 'none'\n }, /*#__PURE__*/React.createElement(View, {\n collapsable: false,\n removeClippedSubviews:\n // On iOS & macOS, set removeClippedSubviews to true only when not focused\n // This is an workaround for a bug where the clipped view never re-appears\n Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true,\n pointerEvents: visible ? 'auto' : 'none',\n style: visible ? styles.attached : styles.detached\n }, children));\n}\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden'\n },\n attached: {\n flex: 1\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY\n }\n});\n//# sourceMappingURL=ResourceSavingView.js.map"]},"metadata":{},"sourceType":"module"}