/* Metro module 6345; source: unknown; dependencies: [31, 33, 1610, 6281, 6343, 6278, 6288, 6319, 4027] */ import React from './module-00031-React.js'; /* Metro dependency 31 */ import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */ import * as Module01610Module from './module-01610.js'; /* Metro dependency 1610 */ import * as Module04027Module from './module-04027.js'; /* Metro dependency 4027 */ import * as Module06278Module from './module-06278.js'; /* Metro dependency 6278 */ import * as Module06281Module from './module-06281.js'; /* Metro dependency 6281 */ import * as BottomSheetModule from './module-06288-BottomSheet.js'; /* Metro dependency 6288 */ import * as BottomSheetHostingContainerModule from './module-06319-BottomSheetHostingContainer.js'; /* Metro dependency 6319 */ function _fun49850(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:6, offset: 0x0120acc9, size: 146 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const env0_2 = value.useCallback; const env0_3 = value.useMemo; const env0_4 = value.useRef; React; value = require(33) /* metro dependency 33 */; const env0_5 = value.jsx; const env0_6 = value.jsxs; exports.default = BottomSheetModalProviderWrapper; function BottomSheetModalProviderWrapper({children}) { // fn#49851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:184, offset: 0x0120ad5b, size: 466 bytes, params: 2, frame: 26 let useSharedValue = Module01610Module.useSharedValue; const INITIAL_CONTAINER_HEIGHT = (Module06281Module).INITIAL_CONTAINER_HEIGHT; const value2 = Reflect.apply(useSharedValue, Module01610Module, [INITIAL_CONTAINER_HEIGHT]); useSharedValue = Module01610Module.useSharedValue; const INITIAL_CONTAINER_OFFSET = (Module06281Module).INITIAL_CONTAINER_OFFSET; const value3 = Reflect.apply(useSharedValue, Module01610Module, [INITIAL_CONTAINER_OFFSET]); const value4 = useMemo(_fun49852, []); const env0_3 = useRef([]); const value5 = useCallback(_fun49853, []); const value6 = useCallback(_fun49855, []); const value7 = useCallback(_fun49857, []); const value10 = useMemo(_fun49863, [useCallback(_fun49859, []), useCallback(_fun49861, [])]); const value11 = useMemo(_fun49864, [value4, value2, value3, value5, value6, value7]); const BottomSheetModalProvider = (BottomSheetModule).BottomSheetModalProvider; const BottomSheetModalInternalProvider = (BottomSheetModule).BottomSheetModalInternalProvider; const BottomSheetHostingContainer = (BottomSheetHostingContainerModule).BottomSheetHostingContainer; const bottomSheetHostingContainer = ; const PortalProvider = (Module04027Module).PortalProvider; return ( {bottomSheetHostingContainer} {children} ); function _fun49852() { // fn#49852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:368, offset: 0x0120af2d, size: 60 bytes, params: 1, frame: 11 let value = environment.__proto__; value = require(6343) /* metro dependency 6343 */; value = value.id(); return 'bottom-sheet-portal-' + value; } function _fun49853(a0, a1, a2) { // fn#49853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:442, offset: 0x0120af69, size: 364 bytes, params: 4, frame: 23 var environment; var r8; var r9; var r7; var r2; var r3; var property; var value4; const MODAL_STACK_BEHAVIOR = (Module06278Module).MODAL_STACK_BEHAVIOR; var ref; var value5; var value7; var value9; const env0_0 = a0; let current = env0_3.current; const value2 = current.slice(); const index = value2.findIndex(_fun49854); if (index === -1) { property = value2[value2.length - 1]; if (property) { if (!property.willUnmount) { value4 = environment.__proto__; if (a2 === MODAL_STACK_BEHAVIOR.replace) { ref = property.ref; value7 = ref == null; if (value7) { r7 = value7; r8 = ref; } else { current = ref.current; r7 = current == null; r8 = current; } if (!r7) { r8.dismiss(); } } else if (a2 === MODAL_STACK_BEHAVIOR.switch) { ref = property.ref; value5 = ref == null; if (value5) { r8 = value5; r9 = ref; } else { current = ref.current; r8 = current == null; r9 = current; } if (!r8) { r9.minimize(); } } } } if (index !== -1) { value2.splice(index, 1); value9 = a1 == null; if (value9) { r2 = value9; r3 = undefined; } else { current = a1.current; r2 = current == null; r3 = current; } if (!r2) { r3.restore(); } } value2.push({key: a0, ref: a1, willUnmount: false}); env0_3.current = value2; } else if (index !== value2.length - 1) { property = value2[value2.length - 1]; if (property) { if (!property.willUnmount) { value4 = environment.__proto__; if (a2 === MODAL_STACK_BEHAVIOR.replace) { ref = property.ref; value7 = ref == null; if (value7) { r7 = value7; r8 = ref; } else { current = ref.current; r7 = current == null; r8 = current; } if (!r7) { r8.dismiss(); } } else if (a2 === MODAL_STACK_BEHAVIOR.switch) { ref = property.ref; value5 = ref == null; if (value5) { r8 = value5; r9 = ref; } else { current = ref.current; r8 = current == null; r9 = current; } if (!r8) { r9.minimize(); } } } } if (index !== -1) { value2.splice(index, 1); value9 = a1 == null; if (value9) { r2 = value9; r3 = undefined; } else { current = a1.current; r2 = current == null; r3 = current; } if (!r2) { r3.restore(); } } value2.push({key: a0, ref: a1, willUnmount: false}); env0_3.current = value2; } function _fun49854({key}) { // fn#49854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:497, offset: 0x00e62956, size: 21 bytes, params: 2, frame: 2 return key === env0_0; } } function _fun49855(a0) { // fn#49855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:933, offset: 0x0120b0d5, size: 219 bytes, params: 2, frame: 16 var r0; var ref; const env0_0 = a0; var value; let binding = env0_3; let current = binding.current; const value2 = current.slice(); const index = value2.findIndex(_fun49856); const value3 = index === value2.length - 1; value2.splice(index, 1); binding.current = value2; const value4 = binding.current.length > 0; const property = binding.current[binding.current.length - 1]; let r1 = value3 && value4 && property && !property.willUnmount; if (r1) { binding = env0_3; current = binding.current; ref = current[binding.current.length - 1].ref; value = ref == null; if (value) { r0 = value; r1 = ref; } else { current = ref.current; r0 = current == null; r1 = current; } if (!r0) { r1.restore(); } } function _fun49856({key}) { // fn#49856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:984, offset: 0x00e62956, size: 21 bytes, params: 2, frame: 2 return key === env0_0; } } function _fun49857(a0) { // fn#49857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1234, offset: 0x0120b1b0, size: 174 bytes, params: 2, frame: 15 var r3; var ref; var value5; const env0_0 = a0; let current = env0_3.current; const value2 = current.slice(); const index = value2.findIndex(_fun49858); const value3 = index === value2.length - 1; if (index !== -1) { value2[index].willUnmount = true; } let r2 = value3 && value2.length > 1; if (r2) { ref = value2[value2.length - 2].ref; value5 = ref == null; if (value5) { r2 = value5; r3 = ref; } else { current = ref.current; r2 = current == null; r3 = current; } if (!r2) { r3.restore(); } } env0_3.current = value2; function _fun49858({key}) { // fn#49858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1285, offset: 0x00e62956, size: 21 bytes, params: 2, frame: 2 return key === env0_0; } } function _fun49859(a0) { // fn#49859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1476, offset: 0x0120b25e, size: 120 bytes, params: 2, frame: 14 var r2; var r3; var r0; var ref; const env0_0 = a0; const binding = env0_3; let current = binding.current; const r1 = a0 ? current.find(_fun49860) : current[binding.current.length - 1]; let value = !!r1; if (r1) { ref = r1.ref; value = ref == null; if (value) { r2 = value; r3 = ref; } else { current = ref.current; r2 = current == null; r3 = current; } value = true; if (r2) { r0 = value; } else { r3.dismiss(); r0 = value; } } else { r0 = value; } return r0; function _fun49860({key}) { // fn#49860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1514, offset: 0x00e62956, size: 21 bytes, params: 2, frame: 2 return key === env0_0; } } function _fun49861() { // fn#49861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1653, offset: 0x0120b2d6, size: 33 bytes, params: 1, frame: 11 env0_3.current.map(function({ref}) { var r0; var r1; var value = ref == null; if (value) { r0 = value; r1 = ref; } else { ref = ref.current; r0 = ref == null; r1 = ref; } if (!r0) { r1.dismiss(); } }); } function _fun49863() { // fn#49863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1761, offset: 0x0120b328, size: 27 bytes, params: 1, frame: 3 return {dismiss: env0_7, dismissAll: env0_8}; } function _fun49864() { // fn#49864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6523:1817, offset: 0x0120b343, size: 61 bytes, params: 1, frame: 3 return {hostName: env0_2, containerHeight: env0_0, containerOffset: env0_1, mountSheet: env0_4, unmountSheet: env0_5, willUnmountSheet: env0_6}; } } } global.__d(_fun49850, 6345, [31, 33, 1610, 6281, 6343, 6278, 6288, 6319, 4027]) /* metro module 6345, dependencies: [31, 33, 1610, 6281, 6343, 6278, 6288, 6319, 4027] */;