/* Metro module 1697; source: unknown; dependencies: [1613, 1614, 1666, 1621, 1696] */ function _fun18544(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#18544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:6, offset: 0x00e8f399, size: 163 bytes, params: 8, frame: 17 let env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Map = global.Map; const map = new Map(); const env0_3 = []; exports.configureWebLayoutAnimations = configureWebLayoutAnimations; exports.insertWebAnimation = insertWebAnimation; exports.scheduleAnimationCleanup = function(a0, a1, a2) { var env0_0 = a0; var env0_1 = a2; var property = global.Math; var value = 5 * a1; value = property.max(value * 1000, a1 + 160); global.setTimeout(_fun18552, value); }; exports.addHTMLMutationObserver = addHTMLMutationObserver; exports.areDOMRectsEqual = function(a0, a1) { return a0.x === a1.x && a0.y === a1.y && a0.width === a1.width && a0.height === a1.height; }; } function findDescendantWithExitingAnimation(a0, a1) { // fn#18545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:199, offset: 0x00e8f43c, size: 130 bytes, params: 3, frame: 16 var environment; var r2; var r3; var isDummy; var removedAfterAnimation; var value; var Array; var from; var children; var length; var value2; var value3; var value4; const HTMLElement = global.HTMLElement; reducibleJoin7: while (true) { if (!(a0 instanceof HTMLElement)) { break reducibleJoin7; } isDummy = a0.isDummy; reducibleJoin3: while (true) { if (isDummy) { removedAfterAnimation = a0.removedAfterAnimation; value = removedAfterAnimation === undefined; r2 = value; break reducibleJoin3; } r2 = isDummy; break reducibleJoin3; } reducibleJoin5: while (true) { if (r2) { reattachElementToAncestor(a0, a1); break reducibleJoin5; } break reducibleJoin5; } Array = global.Array; from = Array.from; children = a0.children; value = Reflect.apply(from, Array, [children]); length = value.length; value2 = 0; value3 = environment; if (!(value2 < length)) { break reducibleJoin7; } r3 = value2; reducibleLoop6: while (true) { findDescendantWithExitingAnimation(value[r3], a1); value4 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; length = value.length; if (value4 < length) { r3 = value4; continue reducibleLoop6; } break reducibleJoin7; } } } function configureWebLayoutAnimations() { // fn#18548, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:758, offset: 0x00e8f5a6, size: 192 bytes, params: 1, frame: 15 var document; var element; var head; var value; if (Reflect.apply((require(1613) /* metro dependency 1613 */).isWindowAvailable, value, [])) { document = global.document; value = document.getElementById('ReanimatedPredefinedWebAnimationsStyle'); if (value === null) { document = global.document; value = document.createElement('style'); value.id = 'ReanimatedPredefinedWebAnimationsStyle'; value.onload = onload; document = global.document; element = document.createElement('style'); element.id = 'ReanimatedCustomWebAnimationsStyle'; document = global.document; head = document.head; head.appendChild(value); document = global.document; head = document.head; head.appendChild(element); } } } function insertWebAnimation(a0, a1) { // fn#18550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:1224, offset: 0x00e8f70a, size: 314 bytes, params: 3, frame: 18 var r3; var elementById; var binding; var set; var length; var value3; var property; var get; var value4; var binding3; var value5; const value = environment; const moduleValue = require(1613) /* metro dependency 1613 */; if (moduleValue.isWindowAvailable()) { elementById = global.document.getElementById('ReanimatedCustomWebAnimationsStyle'); if (elementById.sheet) { elementById.sheet.insertRule(a1, 0); binding = env0_3; binding.unshift(a0); env0_2.set(a0, 0); length = binding.length; value3 = 1; if (value3 < length) { r3 = value3; loopExit4: while (true) { property = env0_3[r3]; binding = env0_2; get = binding.get; value4 = Reflect.apply(get, binding, [property]); if (value4 === undefined) { throw new (require(1621) /* metro dependency 1621 */).ReanimatedError('Failed to obtain animation index.'); } binding = env0_2; set = binding.set; binding3 = env0_3; property = binding3[r3]; Reflect.apply(set, binding, [property, value4 + value3]); value5 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; length = binding3.length; if (value5 < length) { r3 = value5; continue; } break loopExit4; } return undefined; } return undefined; } (require(1614) /* metro dependency 1614 */).logger.error('Failed to create layout animations stylesheet.'); } } function scheduleAnimationCleanup(a0, a1, a2) { // fn#18551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:1640, offset: 0x00e8f844, size: 83 bytes, params: 4, frame: 16 const env0_0 = a0; const env0_1 = a2; const Math = global.Math; let value = 5 * a1; value = Math.max(value * 1000, a1 + 160); global.setTimeout(_fun18552, value); } function addHTMLMutationObserver() { // fn#18553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:2199, offset: 0x00e8f9ec, size: 125 bytes, params: 1, frame: 14 var mutationObserver; if (!env0_4 && (require(1613) /* metro dependency 1613 */).isWindowAvailable()) { mutationObserver = new global.MutationObserver(_fun18554); mutationObserver.observe(global.document.body, {'childList': true, 'subtree': true}); } } function reattachElementToAncestor(a0, a1) { // fn#18546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:322, owner: findDescendantWithExitingAnimation.reattachElementToAncestor, offset: 0x00e8f4be, size: 175 bytes, params: 3, frame: 19 var environment; var onanimationend; const env0_0 = a0; const env0_1 = a1; const value = environment.__proto__; const value2 = (require(1696) /* metro dependency 1696 */).snapshots.get(a0); if (value2) { a0.removedAfterAnimation = true; a1.appendChild(a0); (require(1696) /* metro dependency 1696 */).setElementPosition(a0, value2); onanimationend = a0.onanimationend; a0.onanimationend = onanimationend_18547; } else { (require(1614) /* metro dependency 1614 */).logger.error('Failed to obtain snapshot.'); } } function configureWebLayoutAnimationsOnload() { // fn#18549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:919, owner: configureWebLayoutAnimations.onload, offset: 0x00e8f666, size: 164 bytes, params: 1, frame: 22 var propertyName; var insertRule; var Animations2; var style; let sheet = env0_0.sheet; if (sheet) { for (propertyName in (require(1666) /* metro dependency 1666 */).Animations) { sheet = env0_0.sheet; insertRule = sheet.insertRule; Animations2 = (require(1666) /* metro dependency 1666 */).Animations; style = Animations2[propertyName].style; Reflect.apply(insertRule, sheet, [style]); } } else { (require(1614) /* metro dependency 1614 */).logger.error('Failed to create layout animations stylesheet.'); } } function _fun18552() { // fn#18552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:1723, offset: 0x00e8f897, size: 341 bytes, params: 1, frame: 18 var r3; var elementById; var get; var value3; var sheet; var binding3; var length; var property; var value4; var set; var binding5; var value5; const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError; let binding = env0_0; const value = environment.__proto__; const moduleValue = require(1613) /* metro dependency 1613 */; if (moduleValue.isWindowAvailable()) { elementById = global.document.getElementById('ReanimatedCustomWebAnimationsStyle'); value3 = env1_2.get(binding); if (value3 === undefined) { throw new ReanimatedError('Failed to obtain animation index.'); } importDefault(); sheet = elementById.sheet; if (sheet != null) { sheet.deleteRule(value3); } binding3 = env1_3; binding3.splice(value3, 1); env1_2.delete(binding); length = binding3.length; if (value3 < length) { r3 = value3; loopExit5: while (true) { property = env1_3[r3]; binding = env1_2; get = binding.get; value4 = Reflect.apply(get, binding, [property]); if (value4 === undefined) { throw new ReanimatedError('Failed to obtain animation index.'); } binding = env1_2; set = binding.set; binding5 = env1_3; property = binding5[r3]; Reflect.apply(set, binding, [property, value4 - 1]); value5 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; length = binding5.length; if (value5 < length) { r3 = value5; continue; } break loopExit5; } return undefined; } } } function _fun18554(a0) { // fn#18554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:2295, offset: 0x00e8fa69, size: 231 bytes, params: 2, frame: 19 var r1; var navigation; var r3; var startsWith; var value3; var error; var property2; var child; var memoizedProps; var removedNodes; var value4; var value5; var findDescendantWithExitingAnimationBinding; var property3; var value6; let length = a0.length; const property = a0[length - 1]; let target = property.target; const value = undefined; const value2 = '__reactFiber'; const Object = global.Object; const iterator = Object.keys(target)[Symbol.iterator](); const iterator2 = iterator.next; let r5 = iterator; let item2 = Reflect.apply(iterator2, r5, []); let item = item2.value; item2 = item2.done ? undefined : r5; reducibleJoin2: while (true) { if (item2 === value) { r1 = value2; property2 = target[r1]; reducibleJoin13: while (true) { if (property2 == null) { navigation = value; break reducibleJoin13; } child = property2.child; if (child == null) { navigation = value; break reducibleJoin13; } memoizedProps = child.memoizedProps; if (memoizedProps == null) { navigation = value; break reducibleJoin13; } navigation = memoizedProps.navigation; break reducibleJoin13; } reducibleJoin16: while (true) { if (value !== navigation) { break reducibleJoin16; } removedNodes = property.removedNodes; length = removedNodes.length; value4 = 0; value5 = environment.__proto__; if (!(value4 < length)) { break reducibleJoin16; } r3 = value4; reducibleLoop15: while (true) { findDescendantWithExitingAnimationBinding = findDescendantWithExitingAnimation; removedNodes = property.removedNodes; property3 = removedNodes[r3]; target = property.target; findDescendantWithExitingAnimationBinding(property3, target); value6 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; removedNodes = property.removedNodes; length = removedNodes.length; if (value6 < length) { r3 = value6; continue reducibleLoop15; } break reducibleJoin16; } } return value; } break reducibleJoin2; } reducibleLoop2: while (true) { try { startsWith = item.startsWith; } catch (error) { try { item2.return(); } catch { } throw error; } try { value3 = Reflect.apply(startsWith, item, [value2]); } catch (error) { try { item2.return(); } catch { } throw error; } if (value3) { item2.return(); r1 = item; break reducibleLoop2; } r5 = item2; item2 = Reflect.apply(iterator2, r5, []); item = item2.value; item2 = item2.done ? undefined : r5; if (item2 === value) { r1 = value2; break reducibleLoop2; } continue reducibleLoop2; } property2 = target[r1]; reducibleJoin13: while (true) { if (property2 == null) { navigation = value; break reducibleJoin13; } child = property2.child; if (child == null) { navigation = value; break reducibleJoin13; } memoizedProps = child.memoizedProps; if (memoizedProps == null) { navigation = value; break reducibleJoin13; } navigation = memoizedProps.navigation; break reducibleJoin13; } reducibleJoin16: while (true) { if (value !== navigation) { break reducibleJoin16; } removedNodes = property.removedNodes; length = removedNodes.length; value4 = 0; value5 = environment.__proto__; if (!(value4 < length)) { break reducibleJoin16; } r3 = value4; reducibleLoop15: while (true) { findDescendantWithExitingAnimationBinding = findDescendantWithExitingAnimation; removedNodes = property.removedNodes; property3 = removedNodes[r3]; target = property.target; findDescendantWithExitingAnimationBinding(property3, target); value6 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; removedNodes = property.removedNodes; length = removedNodes.length; if (value6 < length) { r3 = value6; continue reducibleLoop15; } break reducibleJoin16; } } return value; } function reattachElementToAncestorOnanimationend(a0) { // fn#18547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1824:515, owner: findDescendantWithExitingAnimation.reattachElementToAncestor.onanimationend, offset: 0x00e8f56d, size: 57 bytes, params: 2, frame: 13 require.removeChild(env0_0); if (onanimationend != null) { onanimationend.call(this, a0); } }