270 lines
16 KiB
TypeScript
270 lines
16 KiB
TypeScript
/* Metro module 14377; source: modules/home_drawer/native/useHomeDrawerPeekHint.tsx; dependencies: [57, 31, 4502, 14375, 661, 1376, 4017, 1365, 1485, 14378, 566, 14373, 3968, 7013, 4504, 4577, 14374, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import HomeDrawerStore from './HomeDrawerStore.tsx'; /* Metro dependency 14375 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as Module01485Module from '../../../by-id/module-01485.js'; /* Metro dependency 1485 */
|
|
import * as DismissibleContentUnsafeUtilsModule from '../../dismissible_content/DismissibleContentUnsafeUtils.tsx'; /* Metro dependency 3968 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
|
|
import * as UseSelectedDismissibleContentModule from '../../dismissible_content/hooks/useSelectedDismissibleContent.tsx'; /* Metro dependency 7013 */
|
|
import * as UseGuildsRouteGuildIdModule from '../../main_tabs_v2/navigator/useGuildsRouteGuildId.tsx'; /* Metro dependency 14373 */
|
|
import * as UseHomeDrawerGestureModule from './useHomeDrawerGesture.tsx'; /* Metro dependency 14374 */
|
|
import * as UseDrawerStateModule from './useDrawerState.tsx'; /* Metro dependency 14378 */
|
|
|
|
function _fun108802(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:6, offset: 0x0232ee13, size: 350 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Easing = (ReanimatedRexportModule).Easing;
|
|
const inOut = Easing.inOut;
|
|
const Easing2 = (ReanimatedRexportModule).Easing;
|
|
const env0_8 = Reflect.apply(inOut, Easing, [Easing2.cubic]);
|
|
const env0_9 = [];
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const HOME_DRAWER_SWIPE_PEEK_NUX = DismissibleContent.HOME_DRAWER_SWIPE_PEEK_NUX;
|
|
object = [HOME_DRAWER_SWIPE_PEEK_NUX];
|
|
object = {code: 'function useHomeDrawerPeekHintTsx1(){const{gestureState,panelX,PEEK_HINT_DRAWER_DRAG_THRESHOLD}=this.__closure;return gestureState.get().active&&panelX.get()>PEEK_HINT_DRAWER_DRAG_THRESHOLD;}'};
|
|
object = {code: 'function useHomeDrawerPeekHintTsx2(isDragged,wasDragged){const{isPeekGranted,runOnJS,handleDrawerDragged}=this.__closure;if(!isPeekGranted||wasDragged==null)return;if(isDragged&&!wasDragged){runOnJS(handleDrawerDragged)();}}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/home_drawer/native/useHomeDrawerPeekHint.tsx');
|
|
exports.PEEK_HINT_DISTANCE = 40;
|
|
exports.useHomeDrawerPeekHint = useHomeDrawerPeekHint;
|
|
function useHomeDrawerPeekHint(a0, a1) { // fn#108803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:872, offset: 0x0232ef71, size: 944 bytes, params: 3, frame: 32
|
|
let value = a0;
|
|
const env0_0 = a1;
|
|
const value3 = HomeDrawerStore();
|
|
const panelX = value3.panelX;
|
|
const gestureState = value3.gestureState;
|
|
const gestureState2 = gestureState;
|
|
const lastInteractionAt = value3.lastInteractionAt;
|
|
const lastInteractionAt2 = lastInteractionAt;
|
|
const isPanelTouchActive = value3.isPanelTouchActive;
|
|
const noteInteraction = value3.noteInteraction;
|
|
const value4 = (Module01485Module).useIsFocused();
|
|
const value5 = (UseDrawerStateModule).useDrawerOpen(value);
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
let property = gestureState2((UseGuildsRouteGuildIdModule).useGuildsRouteGuildAndChannelId(),
|
|
1)[0];
|
|
const UNSAFE_useIsDismissibleContentDismissed = DismissibleContentUnsafeUtilsModule.UNSAFE_useIsDismissibleContentDismissed;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
let HOME_DRAWER_SWIPE_PEEK_NUX = DismissibleContent.HOME_DRAWER_SWIPE_PEEK_NUX;
|
|
const value8 = !Reflect.apply(UNSAFE_useIsDismissibleContentDismissed, DismissibleContentUnsafeUtilsModule,
|
|
[HOME_DRAWER_SWIPE_PEEK_NUX]);
|
|
let r3 = value && value4 && property != null;
|
|
r3 = r3 && property !== ME && !value5;
|
|
r3 = r3 && !useReducedMotion && value8;
|
|
let binding = lastInteractionAt2;
|
|
const env0_8 = binding.useRef(false);
|
|
value = binding.useState(false);
|
|
value = gestureState2(value, 2);
|
|
property = value[0];
|
|
const property5 = property;
|
|
const property2 = value[1];
|
|
const property22 = property2;
|
|
if (property && !r3) {
|
|
property2(false);
|
|
}
|
|
const useSelectedDismissibleContent = (UseSelectedDismissibleContentModule).useSelectedDismissibleContent;
|
|
value = Reflect.apply(useSelectedDismissibleContent, value, [property && r3 ? property22 : property5, undefined,
|
|
true]);
|
|
value = gestureState2(value, 2);
|
|
const property3 = value[0];
|
|
const property4 = value[1];
|
|
const property42 = property4;
|
|
binding = lastInteractionAt2;
|
|
const env0_12 = binding.useRef(null);
|
|
const env0_13 = binding.useRef(null);
|
|
const env0_14 = binding.useRef(false);
|
|
const env0_15 = binding.useRef(null);
|
|
value = binding.useCallback(_fun108805, [a1]);
|
|
HOME_DRAWER_SWIPE_PEEK_NUX = DismissibleContent.HOME_DRAWER_SWIPE_PEEK_NUX;
|
|
const value9 = property3 === HOME_DRAWER_SWIPE_PEEK_NUX;
|
|
binding.useEffect(_fun108807, [value9, value, property4]);
|
|
value = binding.useCallback(_fun108808, [a1]);
|
|
binding.useEffect(_fun108809, [r3, property, noteInteraction, lastInteractionAt, isPanelTouchActive]);
|
|
binding.useEffect(_fun108812, [value5, value]);
|
|
binding.useEffect(_fun108813, [r3, value]);
|
|
value = binding.useCallback(_fun108814, [value]);
|
|
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
|
|
const useHomeDrawerPeekHintV2 = useHomeDrawerPeekHintV;
|
|
useHomeDrawerPeekHintV2.__closure = {gestureState: gestureState, panelX: panelX, PEEK_HINT_DRAWER_DRAG_THRESHOLD: 8};
|
|
useHomeDrawerPeekHintV2.__workletHash = 15765003051494;
|
|
useHomeDrawerPeekHintV2.__initData = property42;
|
|
const useHomeDrawerPeekHintQ2 = useHomeDrawerPeekHintQ;
|
|
object = {isPeekGranted: value9};
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.handleDrawerDragged = value;
|
|
useHomeDrawerPeekHintQ2.__closure = object;
|
|
useHomeDrawerPeekHintQ2.__workletHash = 10054961085184;
|
|
useHomeDrawerPeekHintQ2.__initData = env0_12;
|
|
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [useHomeDrawerPeekHintV2, useHomeDrawerPeekHintQ2]);
|
|
function _fun108805() { // fn#108805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:1560, offset: 0x0232f321, size: 179 bytes, params: 1, frame: 18
|
|
if (env0_12.current != null) {
|
|
global.clearTimeout(env0_12.current);
|
|
env0_12.current = null;
|
|
}
|
|
env0_14.current = true;
|
|
const set = require.set;
|
|
Reflect.apply(set, require, [TimingModule.withTiming(40, {duration: 1500, easing: env1_8})]);
|
|
env0_13.current = global.setTimeout(_fun108806, 2500);
|
|
function _fun108806() { // fn#108806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:1714, offset: 0x0232f3d4, size: 145 bytes, params: 1, frame: 21
|
|
var binding;
|
|
env1_13.current = null;
|
|
env1_14.current = false;
|
|
const set = require.set;
|
|
const withSpring = SpringModule.withSpring;
|
|
const HOME_DRAWER_FLING_PHYSICS = (UseHomeDrawerGestureModule).HOME_DRAWER_FLING_PHYSICS;
|
|
Reflect.apply(set, require, [Reflect.apply(withSpring, SpringModule, [0, HOME_DRAWER_FLING_PHYSICS])]);
|
|
if (env1_15.current != null) {
|
|
binding = env1_15;
|
|
binding.current(ContentDismissActionType.AUTO_DISMISS);
|
|
}
|
|
env1_10(false);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun108807() { // fn#108807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:1949, offset: 0x0232f465, size: 53 bytes, params: 1, frame: 10
|
|
if (result && !env0_14.current) {
|
|
env0_15.current = env0_11;
|
|
env0_16();
|
|
}
|
|
}
|
|
|
|
function _fun108808() { // fn#108808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2019, offset: 0x0232f49a, size: 197 bytes, params: 1, frame: 17
|
|
var set;
|
|
var value;
|
|
if (env0_12.current != null) {
|
|
global.clearTimeout(env0_12.current);
|
|
env0_12.current = null;
|
|
}
|
|
if (env0_13.current != null) {
|
|
global.clearTimeout(env0_13.current);
|
|
env0_13.current = null;
|
|
}
|
|
if (env0_14.current) {
|
|
env0_14.current = false;
|
|
set = require.set;
|
|
value = environment.__proto__;
|
|
value = require(4577) /* metro dependency 4577: spring */;
|
|
Reflect.apply(set, require, [value.withSpring(0,
|
|
(require(14374) /* metro dependency 14374: useHomeDrawerGesture */).HOME_DRAWER_FLING_PHYSICS)]);
|
|
}
|
|
}
|
|
|
|
function _fun108809() { // fn#108809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2251, offset: 0x0232f55f, size: 95 bytes, params: 1, frame: 15
|
|
if (DismissibleContentConstantsModule.ContentDismissActionType) {
|
|
if (env0_9) {
|
|
return undefined;
|
|
}
|
|
if (env0_8.current) {
|
|
return undefined;
|
|
}
|
|
noteInteraction();
|
|
env0_12.current = global.setTimeout(checkIdle, 2000);
|
|
return _fun108811;
|
|
}
|
|
function checkIdle() { // fn#108810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2296, offset: 0x0232f5be, size: 136 bytes, params: 1, frame: 16
|
|
env1_12.current = null;
|
|
const Date = global.Date;
|
|
const value2 = Date.now();
|
|
const current = lastInteractionAt.current;
|
|
const value3 = 2000;
|
|
const value4 = value3 - (value2 - current);
|
|
const isPanelTouchActiveBinding = isPanelTouchActive;
|
|
const get = isPanelTouchActiveBinding.get;
|
|
if (Reflect.apply(get, isPanelTouchActiveBinding, [])) {
|
|
env1_12.current = global.setTimeout(checkIdle, value4 > 0 ? value4 : value3);
|
|
} else if (value4 > 0) {
|
|
env1_12.current = global.setTimeout(checkIdle, value4 > 0 ? value4 : value3);
|
|
} else {
|
|
env1_10(true);
|
|
}
|
|
}
|
|
|
|
function _fun108811() { // fn#108811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2448, offset: 0x0232f646, size: 56 bytes, params: 1, frame: 13
|
|
if (env1_12.current != null) {
|
|
global.clearTimeout(env1_12.current);
|
|
env1_12.current = null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun108812() { // fn#108812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2541, offset: 0x0232f67e, size: 36 bytes, params: 1, frame: 10
|
|
if (ConstantsModule.ME) {
|
|
env0_8.current = true;
|
|
env0_18();
|
|
}
|
|
}
|
|
|
|
function _fun108813() { // fn#108813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2590, offset: 0x0232f6a2, size: 81 bytes, params: 1, frame: 11
|
|
var current;
|
|
let binding = DismissibleContentConstantsModule.ContentDismissActionType;
|
|
if (!binding && env0_14.current) {
|
|
env0_18();
|
|
current = env0_15.current;
|
|
if (current != null) {
|
|
binding = env0_15;
|
|
current = binding.current;
|
|
value = environment.__proto__;
|
|
Reflect.apply(current, binding, [ContentDismissActionType.AUTO_DISMISS]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun108814() { // fn#108814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2693, offset: 0x0232f6f3, size: 68 bytes, params: 1, frame: 13
|
|
var binding;
|
|
var value2;
|
|
env0_18();
|
|
let current = env0_15.current;
|
|
if (current != null) {
|
|
binding = env0_15;
|
|
current = binding.current;
|
|
value2 = environment.__proto__;
|
|
Reflect.apply(current, binding, [ContentDismissActionType.INDIRECT_ACTION]);
|
|
}
|
|
env0_10(false);
|
|
}
|
|
|
|
function useHomeDrawerPeekHintV() { // fn#108815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2793, owner: useHomeDrawerPeekHint.V, offset: 0x0232f737, size: 47 bytes, params: 1, frame: 10
|
|
var r0;
|
|
var value;
|
|
const gestureStateBinding = gestureState;
|
|
const get = gestureStateBinding.get;
|
|
const active = Reflect.apply(get, gestureStateBinding, []).active;
|
|
if (active) {
|
|
value = panelX.get();
|
|
value = value > 8;
|
|
r0 = value;
|
|
} else {
|
|
r0 = active;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useHomeDrawerPeekHintQ(a0, a1) { // fn#108816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14574:2946, owner: useHomeDrawerPeekHint.Q, offset: 0x0232f766, size: 84 bytes, params: 3, frame: 13
|
|
let value = a0;
|
|
if (result && a1 != null && value && !a1) {
|
|
value = environment.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value.runOnJS(env0_19)();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun108802, 14377, [57, 31, 4502, 14375, 661, 1376, 4017, 1365, 1485, 14378, 566, 14373, 3968, 7013,
|
|
4504, 4577, 14374,
|
|
2]) /* metro module 14377, dependencies: [57, 31, 4502, 14375, 661, 1376, 4017, 1365, 1485, 14378, 566, 14373, 3968, 7013, 4504, 4577, 14374, 2] */;
|